Open
Description
Which package?
intl-datetimeformat/locale-data
Describe the bug
Majority of "short" timezones are missing even for the primary locales of a given timezone.
E.g. the "fr" locale file only defines "long" timezones for the "Europe/Paris" timezone. If you render a short timezone you get "UTC" instead of "CET".
Is there any plans to flesh out the short timezones?
To Reproduce
Reproducible Steps/Repo
Steps to reproduce the behavior:
- Load polyfills
import '@formatjs/intl-datetimeformat/polyfill-force'
import '@formatjs/intl-datetimeformat/add-all-tz' // Add ALL tz data
import '@formatjs/intl-datetimeformat/locale-data/en'
import '@formatjs/intl-datetimeformat/locale-data/fr'
- Render times in the "Europe/Paris" timezone with "short" timeZoneName
const date = new Date()
const options = {
timeZone: "Europe/Paris",
hour: 'numeric',
minute: 'numeric',
timeZoneName: 'short'
}
console.log('en - ', new Intl.DateTimeFormat('en', options).format(date))
console.log('fr - ', new Intl.DateTimeFormat('fr', options).format(date))
- Observe, neither
en
orfr
give "CET". They give GMT and UTC instead.
en - 9:30 PM GMT+1
fr - 21:30 UTC+1
- If you open the locale-data/en.js file it's easy to see that the "Europe/Paris" timeZoneName data only has "long" values specified.
Expected behavior
Preferred behavior would be for the timezone to be CET (or CEST)
en - 9:30 PM CET
fr - 21:30 CET
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Mac OS 14.5 (23F79)
- Browser Arc
- Version 1.58.0 (53136)-RC
- Chromium Engine Version 128.0.6613.85
Additional context
date-fns-timezone displayed CET but date-fns-tz was closer to your polyfills. Is there any intention to flesh out these short timezones? or are they left blank on purpose?