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

DifferenceISODateTime: All steps in DifferenceISODateTime are infallible #3022

Open
anba opened this issue Oct 25, 2024 · 0 comments
Open

DifferenceISODateTime: All steps in DifferenceISODateTime are infallible #3022

anba opened this issue Oct 25, 2024 · 0 comments

Comments

@anba
Copy link
Contributor

anba commented Oct 25, 2024

No steps in DifferenceISODateTime should be fallible now that user-defined calendars are gone.


Also:
Step 10 can be made clearer when using TemporalUnitCategory.

Instead of:

  1. If largestUnit is not dateLargestUnit, then

Use:

  1. If TemporalUnitCategory(largestUnit) is TIME, then

Furthermore:
Step 7 can be simplified when swapping the inputs to CompareISODate:

Current:

  1. Let dateSign be CompareISODate(isoDateTime2.[[ISODate]], isoDateTime1.[[ISODate]]).
    ...
  2. If timeSign = -dateSign, then

Proposed:

  1. Let dateSign be CompareISODate(isoDateTime1.[[ISODate]], isoDateTime2.[[ISODate]]).
    ...
  2. If timeSign = dateSign, then
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

No branches or pull requests

1 participant