Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to 0.9.1 with 2024b #185

Merged
merged 4 commits into from
Sep 9, 2024
Merged

Bump to 0.9.1 with 2024b #185

merged 4 commits into from
Sep 9, 2024

Conversation

djc
Copy link
Member

@djc djc commented Sep 7, 2024

No description provided.

@djc djc enabled auto-merge September 7, 2024 07:57
@djc djc disabled auto-merge September 7, 2024 07:57
@djc djc requested a review from pitdicker September 7, 2024 07:57
@pitdicker
Copy link
Contributor

I'll have a look later today.

@djc
Copy link
Member Author

djc commented Sep 7, 2024

If you want to stop reviewing, that's also fine, just let me know!

@pitdicker
Copy link
Contributor

If you want to stop reviewing, that's also fine, just let me know!

I am doing way less than I feel like I should for chrono. Feel free to ask/cc me anytime!
Got more busy unfortunately.

@pitdicker
Copy link
Contributor

pitdicker commented Sep 7, 2024

With this release the TZDB starts to use %z instead of numerical time zone names such as +01. We have no code to handle this.

It seems to me the cleanest solution is to make the time zone name optional with the None case representing the special %z, and adding some extra code to the formatting method that uses the stuff from FixedOffset. What do you think?

@pitdicker
Copy link
Contributor

Before:

            Tz::Africa__Asmara => {
                const REST: &[(i64, FixedTimespan)] = &[
                    (-1946168836, FixedTimespan { utc_offset: 9000, dst_offset: 0, name: "+0230" }),
                    (-1309746600, FixedTimespan { utc_offset: 10800, dst_offset: 0, name: "EAT" }),
                    (-1261969200, FixedTimespan { utc_offset: 9000, dst_offset: 0, name: "+0230" }),
                    (-1041388200, FixedTimespan { utc_offset: 9900, dst_offset: 0, name: "+0245" }),
                    (-865305900, FixedTimespan { utc_offset: 10800, dst_offset: 0, name: "EAT" }),
                ];
                FixedTimespanSet {
                    first: FixedTimespan {
                        utc_offset: 8836,
                        dst_offset: 0,
                        name: "LMT",
                    },
                    rest: REST
                }
            },

After:

            Tz::Africa__Asmara => {
                const REST: &[(i64, FixedTimespan)] = &[
                    (-1946168836, FixedTimespan { utc_offset: 9000, dst_offset: 0, name: "%z" }),
                    (-1309746600, FixedTimespan { utc_offset: 10800, dst_offset: 0, name: "EAT" }),
                    (-1261969200, FixedTimespan { utc_offset: 9000, dst_offset: 0, name: "%z" }),
                    (-1041388200, FixedTimespan { utc_offset: 9900, dst_offset: 0, name: "%z" }),
                    (-865305900, FixedTimespan { utc_offset: 10800, dst_offset: 0, name: "EAT" }),
                ];
                FixedTimespanSet {
                    first: FixedTimespan {
                        utc_offset: 8836,
                        dst_offset: 0,
                        name: "LMT",
                    },
                    rest: REST
                }
            },

@djc
Copy link
Member Author

djc commented Sep 9, 2024

With this release the TZDB starts to use %z instead of numerical time zone names such as +01. We have no code to handle this.

It seems to me the cleanest solution is to make the time zone name optional with the None case representing the special %z, and adding some extra code to the formatting method that uses the stuff from FixedOffset. What do you think?

Sounds good! Do you have time to work on this?

It seems a little tricky, if I understand correctly we have to do work in chrono to make stuff in chrono-tz work correctly? But chrono-tz takes a dependency on chrono so I guess we'll need to bump chrono-tz to 0.10.0 and then also have it depend on newest chrono?

@pitdicker
Copy link
Contributor

Sounds good! Do you have time to work on this?

Yes, it doesn't seems to involved (hopefully).

@djc
Copy link
Member Author

djc commented Sep 9, 2024

LGTM, thanks! Do you want to formally approve, since I can't?

@pitdicker
Copy link
Contributor

For the formatting code it ended up to be easier to just format the integers instead of trying to make use of the offset formatting code in chrono.

The change to the OffsetName trait to return an Option makes this something that needs a version bump.

With 2024b the TZDB does switches to the %z format in almost all places, but skipped some. We could detect those and treat them like %z, but it seemed best to me to stay as close as possible to the official data.

@pitdicker
Copy link
Contributor

You are quick with the review!

@pitdicker
Copy link
Contributor

I'd like to push one more change. the example file should use Options too.

@pitdicker
Copy link
Contributor

Shall I merge and make the release?

@djc
Copy link
Member Author

djc commented Sep 9, 2024

Yes, please!

@pitdicker pitdicker added this pull request to the merge queue Sep 9, 2024
Merged via the queue into main with commit 6154fd2 Sep 9, 2024
4 checks passed
@pitdicker pitdicker deleted the 0.9.1 branch September 9, 2024 11:22
@pitdicker
Copy link
Contributor

Published 🎉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants