-
Notifications
You must be signed in to change notification settings - Fork 156
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
Incorrect canonical time zone name for Asia/Kolkata #1076
Comments
@ptomato believes this may be a bug in Node's CLDR data. If anyone has insight into the root cause of this problem and/or how to fix it, feel free to pick up this issue! |
These issues seem like a good explanation of the issue, but I haven't read through them to know what are the correct next steps. tc39/ecma402#272 seems like the most comprehensive one. tc39/ecma402#272 (comment) cc @sffc |
|
This definitely seems like something that should be consistent across browsers. @sffc, is this something you could look into on the Chromium and/or 402 side? See 402 and chromium bugs linked above. |
@ryzokuken is assigned the 402 issue. It looks like it requires a fix in CLDR. The CLDR issue is not currently assigned to a milestone, which means someone needs to go in and pick it up. |
On purpose, CLDR has kept old names like Asia/Calcutta. So, it is more than a fix but requires a CLDR policy change on the timezone ID 'stability'. |
Is there a pointer to where this stability policy is documented and/or was discussed? Would be interesting to understand the pros and cons on either side of the decision. FWIW, I assume that there will be increasing pressure from affected countries to fix this, so changes are probably going to happen at some point. Main question is probably when, not if. |
I'm not sure why it requires CLDR fix. In ICU, you can instantiate TimeZone object with both Asia/Kolkata and Asia/Calcutta. When you create a TimeZone object with zone ID "Asia/Kolkata", then TimeZone#getId() returns "Asia/Kolkata". "Asia/Kolkata" is mapped to "Asia/Calcutta" when you call TimeZone#getCanonicalID(), and it is returning CLDR canonical ID. CLDR canonical ID is used for resolving time zone display names in CLDR data.
As long as you accept "Asia/Kolkata", and returns "Asia/Kolkata" as its ID, then I don't think it's an issue. |
Whatever the outcome, this needs to be handled in 402. |
For future readers: the root issue about which IDs should be canonical is tc39/ecma402#272. This issue should be focused on what Temporal is going to do (if anything) about time zone canonicalization issues.
FWIW, this is not the current Temporal behavior. I'm going to re-open this issue so we can decide how Temporal should act re: timezone ID canonicalization. The root cause (and perhaps the final solution too?) may be in 402, but regardless of the solution it also might require changes in Temporal's API and/or implementation as noted below. So it makes sense to keep a tracking issue on the Temporal side. If the current canonical names stay as-is in the source data, then it seems like we (meaning Temporal and/or 402) have two choices:
A problem with (1) is that it interferes with using Another issue with (1): some Temporal operations are allowed vs. forbidden depending on matching time zones. For example, On the other hand, a challenge with (2) is that different JS environments have solved the "stale canonical ID" problem in different ways. Firefox, for example, canonicalizes to We could make ID canonicalization a caller-facing option in At this point I'd lean the course of action below in Temporal (which might require some help from 402):
|
ECMA 402 is an internationalization specification, while ECMA 262 Temporal as a date and time specification. The use cases may overlap, but they are not identical, and I don't think allowing divergence should be off the table. There are also some other things worth noting:
|
I don't agree with this proposal for the following reasons.
They only do this because, as I understand it, ICU makes a distinction between "ID" and "canonical ID". JS does not (and I don't believe it's necessary to do so, but if it were to change then I believe that ECMA-402 should lead here and not Temporal.)
I don't agree with the interpretation that this is a decision to solve things differently across browsers. I am 99% sure this is just a bug in Chrome that has nothing to do with Temporal. Backwards compatible aliases are defined in the tzdata's
This is in tl;dr I don't think any change is needed, I'm 99% sure the Calcutta name is a Chrome bug, and I think that backzones are not a use case for Temporal and should be done in userland. I believe this issue should be closed. |
The closest prior art we have in terms of canonicalization is Intl.Locale. We unconditionally canonicalize it, with a reference top UTS 35: https://tc39.es/ecma402/#sec-canonicalizeunicodelocaleid For example: new Intl.Locale("iw").toString()
// "he" Therefore I think it is okay if Temporal.TimeZone canonicalizes on input. It would be best though if we can point to a specification on exactly how to perform the canonicalization, like we do in Intl.Locale. |
Closing, unless someone can convince me that this is not just a bug in Chrome 😄 |
According to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, Asia/Calcutta is an alias and Asia/Kolkata is canonical.
The text was updated successfully, but these errors were encountered: