Intl.DateTimeFormat with en-CA locale gives unexpected values since FF 109 beta
Categories
(Core :: Internationalization, defect)
Tracking
()
People
(Reporter: bart, Unassigned)
Details
Steps to reproduce:
I'm testing a website I'm developing in FF 109b2. What was working as expected in FF 108 is not in 109b2.
This particular line of JS:
new Intl.DateTimeFormat("en-CA", {dateStyle: "short"}).format(new Date(1234567890))
Actual results:
"1/14/70" is produced in 109b2. This a US date format.
Expected results:
"1970-01-14" is produced in 108 and earlier.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Internationalization' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
That's intended. I18n results are best-effort and may change over time as data on locales gets improved. In this case, en-CA date formats have been improved and all computer systems will migrate to new ones - https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-dates-modern/main/en-CA/ca-gregorian.json#L323-L327
If you were trying to get non-localized (ISO) dates using en-CA
locale, please, do not rely on i18n for stable outputs.
Reporter | ||
Comment 3•2 years ago
|
||
In this case, en-CA date formats have been improved
But in Canada we don't use "month day year", which is what is now being returned. That's a regression, not an improvement.
See https://en.m.wikipedia.org/wiki/Date_and_time_notation_in_Canada
Comment 4•2 years ago
|
||
For what it's worth, here is where it's defined in the CLDR data that's backing this Intl call.
Description
•