-
Notifications
You must be signed in to change notification settings - Fork 185
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
Does ZoneVariant
need to be an open enum?
#5745
Comments
The TZDB concept of daylight saving time is distinct from the CLDR concept of a zone variant. It's coincidental that one is often derivable from the other. I think one example of the difference is that the CLDR daylight variant is always a positive offset from the standard variant, whereas TZDB daylight savings time could be positive or negative. But maybe we could push to make the two concepts align. That's a decision for CLDR, not for us, I think. |
You can choose whether to enable negative DST when building TZDB. I think they are the same concept. |
Conclusion:
LGTM: @sffc @robertbastian @Manishearth |
To write down specific ways deserialization efficiency can be improved:
|
Counter-example to the notion that TZDB only reports a DST bit: from the docs in https://web.cs.ucla.edu/~eggert/tz/tz-how-to.html A time zone definition could look like:
The "LETTER" column has more than just daylight and standard time: it also defines "war" and "peace" time. I think it's well-defined for CLDR to declare display names for those zone variants. Likewise, Ramadan getting its own modifier letter like "R" seems plausible. This changes my position to thinking that an open enum was the right call originally, but I'm not going to push to revert the change given that it already landed and the non-exhaustiveness gives us flexibility. |
The letters get inserted into the TZ name, which is something like |
I don't think there's any more action on this issue. |
TZDB inherently only supports two values for the zone variant,
DST
is a bool in its data model.In ICU4X we currently model this more openly, and say thing like "concepts such as Standard, Summer, Daylight, and Ramadan time". However, it is unclear whether CLDR will ever adopt more variants without TZDB being able to model them.
Making this enum exhaustive lets us reduce data size for specific display names, as we will need fewer
ZeroMap
s.The text was updated successfully, but these errors were encountered: