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

Editorial: Replace AddDateTime with AddDate #2882

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Conversation

anba
Copy link
Contributor

@anba anba commented Jun 5, 2024

Replacing AddDateTime with AddDate makes it easier (for implementers) to see why it's okay to skip all time duration normalization steps.

e283b59:

  • Avoid creating a normalized duration record whose time component is always zero.

9e220c7:

  • Read time components directly from input date-time.

0739c71:

  • And finally replace AddDateTime with AddDate in NudgeToCalendarUnit.

aee3538:

  • Same changes as the first three commits, but this time for NudgeToZonedTime.

5776d1a:

  • Same changes as the first three commits, but this time for BubbleRelativeDuration.

spec/duration.html Show resolved Hide resolved
@ptomato
Copy link
Collaborator

ptomato commented Jun 7, 2024

@anba If you're not in too much of a hurry with this, I'd like to wait until after the TC39 meeting next week when it's clear if there is agreement on removing user-defined calendars.

@anba
Copy link
Contributor Author

anba commented Jun 7, 2024

No, there's no hurry.

Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Basically looks fine, there's a discrepancy in internal slot names though. Thanks!

spec/duration.html Show resolved Hide resolved
spec/duration.html Outdated Show resolved Hide resolved
spec/duration.html Outdated Show resolved Hide resolved
spec/duration.html Outdated Show resolved Hide resolved
anba added 6 commits July 1, 2024 08:46
Adding a zero-time duration in AddDateTime means that the output
date-time record has the same time components as the input date-time
record. This allows to directly read the time components from the input
date-time record.
Calling AddDateTime with a zero-time duration is equivalent to directly
calling AddDate.
@anba
Copy link
Contributor Author

anba commented Jul 1, 2024

Rebased to apply on main.

Implements the editorial improvements from the previous commits, in order
to make the reference code follow the spec text more closely.
@ptomato
Copy link
Collaborator

ptomato commented Jul 1, 2024

Added a commit to reflect the spec text changes in the polyfill as well, though it has no discernible effect.

@ptomato ptomato merged commit 36f16d9 into tc39:main Jul 1, 2024
5 checks passed
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.

None yet

2 participants