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

Test that Intl.DateTimeFormat canonicalizes the timezones "Etc/GMT", "Etc/UTC", and "GMT" to "UTC" #4328

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

ben-allen
Copy link
Contributor

fix #4327

@ben-allen ben-allen requested a review from a team as a code owner November 15, 2024 23:32
@Ms2ger Ms2ger enabled auto-merge (squash) November 18, 2024 09:18
@Ms2ger Ms2ger merged commit bf9f54c into tc39:main Nov 18, 2024
11 checks passed
const utcIdentifiers = ["Etc/GMT", "Etc/UTC", "GMT"];

for (const timeZone of utcIdentifiers) {
assert.sameValue(new Intl.DateTimeFormat([], {timeZone}).resolvedOptions().timeZone, "UTC", "Time zone name " + timeZone + " not canonicalized to 'UTC'.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of the Time Zone Canonicalization proposal which is stage 3, resolvedOptions().timeZone gives the case-regularized original identifier, not the primary identifier. I'll open a PR to fix this.

ptomato added a commit to ptomato/test262 that referenced this pull request Dec 4, 2024
The test for tc39/ecma402#724 (added in
tc39#4328) didn't take the Time Zone
Canonicalization proposal into account; but it should, because that
proposal is stage 3.

As of that proposal, the [[TimeZone]] slot of DateTimeFormat gets the
case-regularized original identifier, no longer the primary identifier. So
the resolvedOptions().timeZone property also no longer returns the primary
identifier.
ptomato added a commit to ptomato/test262 that referenced this pull request Jan 16, 2025
The test for tc39/ecma402#724 (added in
tc39#4328) didn't take the Time Zone
Canonicalization proposal into account; but it should, because that
proposal is stage 3.

As of that proposal, the [[TimeZone]] slot of DateTimeFormat gets the
case-regularized original identifier, no longer the primary identifier. So
the resolvedOptions().timeZone property also no longer returns the primary
identifier.
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.

Need to add test for ECMA402 PR #724
3 participants