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

New tests for Temporal.ZonedDateTime.p.toLocaleString #3814

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Apr 10, 2023

In tc39/proposal-temporal#2522 which reached consensus at the March 2023 TC39 meeting, the functionality of Temporal.ZonedDateTime.p.toLocaleString was changed substantially, to not directly pass the ZonedDateTime to any Intl.DateTimeFormat methods. This adds rewrites of all existing tests for toLocaleString, as well as a few tests to verify that Intl.DateTimeFormat methods no longer support Temporal.ZonedDateTime arguments.

As we are rewriting the tests anyway, this also ports a bunch of toLocaleString tests that were in staging, to the correct format for the main tree.

Comment on lines +13 to +14
const {timeZone, ...options} = formatter.resolvedOptions();
const datetime = new Temporal.ZonedDateTime(0n, timeZone);
Copy link
Contributor

Choose a reason for hiding this comment

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

Praise: Nice use of the spread operator to separate the time zone from the options

In tc39/proposal-temporal#2522 which reached
consensus at the March 2023 TC39 meeting, the functionality of
Temporal.ZonedDateTime.p.toLocaleString was changed substantially, to not
directly pass the ZonedDateTime to any Intl.DateTimeFormat methods. This
adds rewrites of all existing tests for toLocaleString, as well as a few
tests to verify that Intl.DateTimeFormat methods no longer support
Temporal.ZonedDateTime arguments.

As we are rewriting the tests anyway, this also ports all of the
Temporal.ZonedDateTime.p.toLocaleString tests that were in staging, to the
correct format for the main tree.
I wrote a similar test for Temporal.ZonedDateTime.p.toLocaleString, so
while this was fresh I decided to do the same for the other toLocaleString
calendar mismatch tests that were in staging.
@Ms2ger Ms2ger merged commit 801a5bb into tc39:main Apr 11, 2023
@ptomato ptomato deleted the temporal-2522 branch April 11, 2023 17:19
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.

3 participants