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

Slightly inaccurate information provided for getTimeZones() #33691

Open
jackdeguest opened this issue May 21, 2024 · 1 comment · May be fixed by #34407
Open

Slightly inaccurate information provided for getTimeZones() #33691

jackdeguest opened this issue May 21, 2024 · 1 comment · May be fixed by #34407
Labels
Content:JS JavaScript docs

Comments

@jackdeguest
Copy link
Contributor

jackdeguest commented May 21, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones

What specific section or headline is this issue about?

Return value

What information was incorrect, unhelpful, or incomplete?

The Return value section states:

An array of strings representing supported time zones for the associated Locale, where each value is an IANA time zone canonical name, sorted in alphabetical order. If the locale identifier does not contain a region subtag, the returned value is undefined.

However, this is slightly inaccurate, as it may lead the developer into thinking it can bank on the fact this will only return IANA time zone value, which is not true. The LDML specifically states that, for consistency, it keeps time zones that have been removed by IANA.

CLDR contains locale data using a time zone ID from the tz database as the key, stability of the IDs is critical.

and

Not all TZDB links are in CLDR aliases. CLDR purposefully does not exactly match the Link structure in the TZDB.

See https://unicode.org/reports/tr35/#Time_Zone_Identifiers

What did you expect to see?

I would propose to change this to the following, with changes in emphasis:

An array of strings representing supported time zones for the associated Locale, where each value is an IANA time zone canonical name, sorted in alphabetical order. If the locale identifier does not contain a region subtag, the returned value is undefined. Keep in mind that the values do not necessarily match the IANA database that changes from time to time. The Unicode LDML keeps old time zones for stability purpose.

Do you have any supporting links, references, or citations?

LDML specifications section on time zone

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@jackdeguest jackdeguest added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 21, 2024
@github-actions github-actions bot added the Content:JS JavaScript docs label May 21, 2024
@Josh-Cena
Copy link
Member

Hmmm. Yeah. I think due to stability requirements it's not possible for it to strictly match IANA. Would be interesting to see a PR.

@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 21, 2024
@Josh-Cena Josh-Cena linked a pull request Jun 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants