Open Bug 1751833 Opened 3 years ago Updated 1 year ago

month: 'numeric' option ignored by Intl.DateTimeFormat constructor using Hebrew calendar

Categories

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

Firefox 96
defect

Tracking

()

REOPENED
Tracking Status
firefox-esr91 --- unaffected
firefox96 --- wontfix
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- wontfix

People

(Reporter: justin, Unassigned)

References

(Regression)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0

Steps to reproduce:

dtf = new Intl.DateTimeFormat(`en-US-u-ca-hebrew`, {
  day: 'numeric',
  month: 'numeric',
  year: 'numeric',
  era: 'short',
  timeZone: 'UTC'
});
parts = dtf.formatToParts(new Date('2019-02-06T00:00Z'));
parts.filter(p => p.type === 'month')[0];

Actual results:

{ type: "month", value: "Adar I" }

Intl.DateTimeFormat, in the Hebrew calendar only, is ignoring the month: 'numeric' option passed into the constructor and is instead formatting the month as if the month: 'long' option were used.

This change (from FF 95=>96) broke the Temporal polyfill which relies on the output of DateTimeFormat#formatToParts. See https://github.com/tc39/proposal-temporal/issues/2015 for more context.

Expected results:

The same output as FF 95, latest Chrome 97.0.4692.99, and latest Safari 15.2 (17612.3.6.1.6):

{ type: "month", value: "6" }

The Bugbug bot thinks this bug should belong to the 'Core::Internationalization' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Internationalization
Product: Firefox → Core
Component: Internationalization → JavaScript: Internationalization API
Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Keywords: regression
Regressed by: 1738422
Flags: needinfo?(gtatum)
Assignee: nobody → gtatum
Flags: needinfo?(gtatum)

The components bag generates the skeleton: "GyMd"
CLDR says that this should translate to: "d MMM y GGGGG"
This was changed in v40 of the CLDR data.

It looks like Chrome Canary behaves the same here, which mostly likely is running off of the same CLDR data.

I believe this is not a bug, as the translator decision should override the developer decision from the components bag. If this is not correct, then I believe the proper place to fix this is in the CLDR translations.

Let me know Justin if you disagree with the analysis.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

This is the same behavior as Bug 1752253.

I'm going to tentatively re-open, since Bug 1752253 has the same issue, and looks like a bug.

Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Severity: -- → S4
Priority: -- → P3

Greg, you marked that as an S4, can you confirm that it has low to no impact to users and we can mark it as wontfix for 98? thanks

Flags: needinfo?(gtatum)

Yes, this is low impact for users.

The fix here is to upstream the error to CLDR, or to create a custom tailoring of our locale data to fix it. I don't know that we have the custom tailoring already built in to the CLDR update code, but I haven't investigated further.

Flags: needinfo?(gtatum)

I'm unassigning myself from this, as I'm not actively working on it. I can circle back to confirm the fix when CLDR-15510 is addressed.

Assignee: gtatum → nobody
You need to log in before you can comment on or make changes to this bug.