-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Intl.DateTimeFormat.format() output for fi locale no longer matches chrome or latest ICU data (v22) #56737
Comments
Hey, thanks for the report. I've never back ported anything from V8, I can give it a try. |
@nodejs/i18n-api |
hi @michaelfaith thanks for filing this. Please include the source to the test for the record, which I'll include here: (I'm not familiar with code sandbox) const options = {
month: 'short',
day: "numeric"
};
const enFormatter = new Intl.DateTimeFormat('en', options);
const fiFormatter = new Intl.DateTimeFormat('fi', options);
console.log(`en: ${enFormatter.format(new Date())}`);
console.log(`fi: ${fiFormatter.format(new Date())}`); |
Working as designed, matches CLDR 46 data (ICU 76.1). A date format change is not a regression, more comments here: #51090 (comment) |
@targos appreciate the team mention as always… |
@srl295 But it doesn't match CLDR 46 data. It's returning the equivalent of numeric month format, when requesting |
The month name wasn't changed to You are requesting: const options = {
month: 'short',
day: "numeric"
}; In CLDR terms, this is turned into a "date format skeleton". Don't worry, no scary music! The skeleton generated here is Go to the chart you linked to and visit https://unicode.org/cldr/charts/46/delta/fi.html#Formats%20-%20Flexible%20-%20Date%20Formats and you will see:
The chart also shows that this used to be You can actually inspect this in Node.js as follows: > fiFormatter.resolvedOptions()
{
…
month: 'numeric',
day: 'numeric'
} note that the 'month' resolved to numeric. also: > fiFormatter.formatToParts(new Date())
[
{ type: 'day', value: '29' },
{ type: 'literal', value: '.' },
{ type: 'month', value: '1' },
{ type: 'literal', value: '.' }
] |
@michaelfaith anyway I also confirmed that this was a purposeful change, discussed and vetted. If you think it's in error (incorrect culturally), you could submit a ticket upstream at cldr.unicode.org or, even better, get involved in the Finnish vetting process. |
@srl295 This was super helpful. Thanks for the thorough explanation. |
Version
22.13
Platform
Subsystem
No response
What steps will reproduce the bug?
v22 sandbox (incorrect month format): https://codesandbox.io/p/devbox/node22-finnish-datetimeformat-bug-vt3jx6
v20 sandbox (correct): https://codesandbox.io/p/devbox/node22-finnish-datetimeformat-bug-v20-f8zvvg
How often does it reproduce? Is there a required condition?
Consistently
What is the expected behavior? Why is that the expected behavior?
FI
short
month format should match ICU data. Finnish month inshort
format should be the abbreviated version of the month (e.g.tammik.
)What do you see instead?
It currently is outputting the same as
numeric
format. e.g.1.
Additional information
I noticed that the ICU data did change in the November update for the Finnish locale, but not in this way. This only seems to be impacting Finnish from what I can tell, and only the
short
month format. Furthermore, this is working fine in v20. It only presented this regression after updating to v22.The text was updated successfully, but these errors were encountered: