Intl.DateTimeFormat wrong output for pt-PT
Categories
(Core :: JavaScript: Internationalization API, defect, P3)
Tracking
()
People
(Reporter: hafan72971, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Steps to reproduce:
pt-PT and pt-BR are quite the same on most instances, but for some reason, the outputs produced by the DateTimeFormat.format function are quite different between both locales, and this seems to be wrong. When requiring month: 'short', that notation is not even being considered for the pt-PT locale.
From some additional experiences I've done, this is also happening for the formatRange function as well.
This is the first bug I've opened. If for some reason this is not the right the place, would you be so kind to let me know where I can correctly report it? Thanks
const date = new Date(Date.UTC(2022, 5, 10));
const options = { month: 'short', day: 'numeric'};
console.log(new Intl.DateTimeFormat('pt-BR', options).format(date));
console.log(new Intl.DateTimeFormat('pt-PT', options).format(date));
Actual results:
"10 de jun."
"10/06"
Expected results:
"10 de jun."
"10 de jun."
Comment 1•4 years ago
|
||
This looks like an intentional difference when reading the underlying CLDR data:
- pt-PT:
MMMdhas the format stringd/MM: https://github.com/unicode-org/cldr/blob/909c605dfa21f799c2b0d3108298b871eb34ab03/common/main/pt_PT.xml#L1920 - pt (pt-BR):
MMMdhas the format stringd 'de' MMM: https://github.com/unicode-org/cldr/blob/909c605dfa21f799c2b0d3108298b871eb34ab03/common/main/pt.xml#L1435
If this format doesn't follow the standard format used in Portugal, it should be reported at https://unicode-org.atlassian.net.
Comment 2•4 years ago
|
||
Assuming André is correct, then our implementation is compliant with the standard.
Thus flagging this issue as works-for-me.
Feel free to re-open this issue if there is a problem in our implementation of the standard.
Description
•