Closed Bug 1999917 Opened 2 months ago Closed 1 day ago

No formatted output for large dates when using Chinese/Dangi calendars

Categories

(Core :: JavaScript: Internationalization API, defect, P3)

defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

js> new Intl.DateTimeFormat("en-u-ca-chinese", {timeZone:"UTC"}).format(new Date("+100000-01-01T00:00:00.000Z"))
"/"

Returning "/" indicates there's some issue with ICU.

This is an issue in ICU4C's computeMonthInfo function:

  • computeMonthInfo gets called with gyear=100000 and days=35804722.
  • solsticeAfter is computed as 35805412.
  • days=35804722 < solsticeAfter=35805412, so solsticeBefore is computed from gyear-1 = 99999. The computed value is solsticeBefore = 35805047.
  • That means days=35804722 < solsticeBefore=35805047, so this check fails and U_ILLEGAL_ARGUMENT_ERROR is returned.

Updating to ICU4X 2.1.1 (bug 1997048) should allow to remove the fallback code in ICU4XChineseBasedCalendar, which should fix this bug.

Depends on: 1997048
Blocks: sm-icu
Severity: -- → S3
Priority: -- → P3
Duplicate of this bug: 2005091

We no longer need the fallback code after the upgrade to ICU4X 2.1.1, because
ICU4X can now handle all supported years.

Pushed by andre.bargull@gmail.com: https://github.com/mozilla-firefox/firefox/commit/818473254269 https://hg.mozilla.org/integration/autoland/rev/359bd42b605d Remove no longer needed ICU4C calendar fallback code. r=spidermonkey-reviewers,dminor
Component: JavaScript: Standard Library → JavaScript: Internationalization API
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: