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

Temporal: Tests for correct intermediate value in ZonedDateTime difference/rounding #4012

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Feb 20, 2024

These test cases ensure that DST disambiguation does not take place on intermediate values that are not the start or the end of the calculation.

Note that NormalizedTimeDurationToDays is no longer called inside Temporal.Duration.prototype.add/subtract, so a few tests can be deleted.

Other tests need to be adjusted because NormalizedTimeDurationToDays is no longer called inside Temporal.ZonedDateTime.prototype.since/until via DifferenceZonedDateTime, although it is still called as part of rounding.

In addition, new tests for the now-fixed edge case are added.

See tc39/proposal-temporal#2760, a normative change approved in the TC39 plenary of 2024-02.

@ptomato ptomato requested a review from a team as a code owner February 20, 2024 01:30
@ptomato
Copy link
Contributor Author

ptomato commented Mar 5, 2024

I'm expecting there may be more comments on the normative PR, so this may get updated as well.

@ptomato
Copy link
Contributor Author

ptomato commented Mar 30, 2024

I don't expect any more comments on the normative PR, so this is ready as far as I'm concerned. The two tests named dst-month-day-boundary.js are new ones that I've added in case anyone wants to take a look. They are straightforward regression tests for the bug that @arshaw found during review of that normative PR.

I'll plan to merge this Monday unless anyone hollers.

ptomato and others added 3 commits April 1, 2024 16:35
…rence/rounding

These test cases ensure that DST disambiguation does not take place on
intermediate values that are not the start or the end of the calculation.

Note that NormalizedTimeDurationToDays is no longer called inside
Temporal.Duration.prototype.add/subtract, so a few tests can be deleted.

Other tests need to be adjusted because NormalizedTimeDurationToDays is
no longer called inside Temporal.ZonedDateTime.prototype.since/until via
DifferenceZonedDateTime, although it is still called as part of rounding.

In addition, new tests for the now-fixed edge case are added, and for the
day corrections that can happen to intermediates.

See tc39/proposal-temporal#2760
@ptomato ptomato merged commit 1e3d8cb into tc39:main Apr 2, 2024
8 of 9 checks passed
@ptomato ptomato deleted the temporal-2760 branch April 2, 2024 00:44
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