-
Notifications
You must be signed in to change notification settings - Fork 153
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
Next batch of editorial issues #2934
Commits on Sep 11, 2024
-
Tests: Fix setup code in test file
If running this test file without first importing the proposal polyfill, it would fail due to the new intrinsics not being defined. We never noticed this because we usually run datemath.mjs before this file.
Configuration menu - View commit details
-
Copy full SHA for be3c64d - Browse repository at this point
Copy the full SHA be3c64dView commit details -
Polyfill: Perform eraYear checks only if calendar has eras
In the calendar-specific code, in isoToCalendarDate(), we should not be computing the era year if the calendar doesn't have eras.
Configuration menu - View commit details
-
Copy full SHA for a342f77 - Browse repository at this point
Copy the full SHA a342f77View commit details -
Polyfill: Ignore eraYear in calendars without eras
In 'hebrew', 'chinese', and 'dangi' calendars, there are no eras. Any eraYear property given in calendar fields must be ignored, as per CalendarResolveFields in the spec text. Adjust the helpers for Hebrew and Chinese/Dangi calendars accordingly; the eraYear was being used in place of the year in some cases. Closes: #2870
Configuration menu - View commit details
-
Copy full SHA for f2f503a - Browse repository at this point
Copy the full SHA f2f503aView commit details -
Editorial: Use calendar addition to calculate weeks start
This was an overzealous replacement of CalendarDateAdd with BalanceISODate spotted by Anba. It doesn't produce any observably different results, because in all supported calendars weeks are always 7 days; but it's still conceptually incorrect. Go back to using CalendarDateAdd here. Closes: #2881
Configuration menu - View commit details
-
Copy full SHA for ff962ee - Browse repository at this point
Copy the full SHA ff962eeView commit details -
Editorial: Fix typo in loop comparison operator
Otherwise the loop would not run. Closes: #2890
Configuration menu - View commit details
-
Copy full SHA for c04771d - Browse repository at this point
Copy the full SHA c04771dView commit details -
Editorial: Simplify early return condition in BubbleRelativeDuration
As pointed out by Anba, this AO does nothing if smallestUnit equals largestUnit, not just if smallestUnit equals "year". We can simplify the early return condition. See: #2890
Configuration menu - View commit details
-
Copy full SHA for 3595dbd - Browse repository at this point
Copy the full SHA 3595dbdView commit details -
Editorial: Remove dead clause in BubbleRelativeDuration
smallestUnit is a date unit. In the loop, unitIndex runs from the index before smallestUnit and is decremented, meaning that unit can only ever be "year", "month", or "week". Thanks to Anba for spotting this. See: #2890
Configuration menu - View commit details
-
Copy full SHA for 145837a - Browse repository at this point
Copy the full SHA 145837aView commit details -
Editorial: Use ToIntegerWithTruncation in GetRoundingIncrementOption
Same thing, just shorter and clearer. Closes: #2923
Configuration menu - View commit details
-
Copy full SHA for 51c0530 - Browse repository at this point
Copy the full SHA 51c0530View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a13640 - Browse repository at this point
Copy the full SHA 4a13640View commit details -
Editorial: Remove unthrowable exception from duration rounding
It's not possible for the duration to not be valid here, as _duration_ is a valid duration, and the duration being tested is _duration_ truncated to days, which can only ever be less than _duration_. Spotted by Anba. Closes: #2880
Configuration menu - View commit details
-
Copy full SHA for 9b2b18e - Browse repository at this point
Copy the full SHA 9b2b18eView commit details -
Polyfill: Remove eras from buddhist, ethioaa, indian, islamic*, persi…
…an calendars Dates in these calendars display an era when they are formatted in English using Intl.DateTimeFormat, but not when they are formatted for the region where the calendar is used. That likely indicates they shouldn't have eras. Remove `constantEra` from the calendar helpers, and introduce a new helper that calculates dates relative to a fixed year zero. Closes: #2899
Configuration menu - View commit details
-
Copy full SHA for 6969559 - Browse repository at this point
Copy the full SHA 6969559View commit details -
Polyfill: Implement era aliases
As of the current state of the Intl Era and Month Codes proposal, the eras table in https://tc39.es/proposal-intl-era-monthcode/#table-eras has a canonical name for each era, and a number of aliases which should also be accepted. Legacy ICU names such as "era0" should not be accepted, although they still need to be handled when using Intl.DateTimeFormat to convert dates. Closes: #2901
Configuration menu - View commit details
-
Copy full SHA for 14b3060 - Browse repository at this point
Copy the full SHA 14b3060View commit details -
Polyfill: Save a few property copies in calendar helpers
The makeHelper___() functions already return a new object, so we don't need to Object.assign() them to {}.
Configuration menu - View commit details
-
Copy full SHA for aa98260 - Browse repository at this point
Copy the full SHA aa98260View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e74b87 - Browse repository at this point
Copy the full SHA 0e74b87View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5cc2c1 - Browse repository at this point
Copy the full SHA a5cc2c1View commit details