Skip to content
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 polyfill doesn't support Etc/GMT[+-]{offset} timezones #2609

Closed
kevindetry opened this issue Feb 15, 2021 · 3 comments
Closed
Labels

Comments

@kevindetry
Copy link

Which package?

@formatjs/intl-datetimeformat

Describe the bug

Intl.DateTimeFormat polyfill throws an Invalid timeZoneName error if the timezone is set to Etc/GMT+0 (or any other Etc/GMT[+-]{offset}).

To Reproduce

Codesandbox URL

https://codesandbox.io/s/wizardly-jones-x9g8s (formatting is broken and error is displayed in console)

Expected behavior

Etc/GMT[+-]{offset} timezones should be supported since they're part of tzdata.

Additional context

This change in luxon library revealed the issue. There's also a link to the Chrome issue tracker, where they've discussed those timezones.

@kevindetry kevindetry added the bug label Feb 15, 2021
@longlho
Copy link
Member

longlho commented Feb 15, 2021

Etc/GMT+0 and such are not valid iana timezone names afaik

@kevindetry
Copy link
Author

They seem to be valid:

$ curl -O https://data.iana.org/time-zones/releases/tzdb-2021a.tar.lz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  481k  100  481k    0     0   633k      0 --:--:-- --:--:-- --:--:--  632k
$ tar xf tzdb-2021a.tar.lz
$ cd tzdb-2021a/
$ make zonenames | grep Etc/GMT
Etc/GMT
Etc/GMT-0
Etc/GMT+0
Etc/GMT0
Etc/GMT-14
Etc/GMT-13
Etc/GMT-12
Etc/GMT-11
Etc/GMT-10
Etc/GMT-9
Etc/GMT-8
Etc/GMT-7
Etc/GMT-6
Etc/GMT-5
Etc/GMT-4
Etc/GMT-3
Etc/GMT-2
Etc/GMT-1
Etc/GMT+1
Etc/GMT+2
Etc/GMT+3
Etc/GMT+4
Etc/GMT+5
Etc/GMT+6
Etc/GMT+7
Etc/GMT+8
Etc/GMT+9
Etc/GMT+10
Etc/GMT+11
Etc/GMT+12

@longlho
Copy link
Member

longlho commented Feb 15, 2021

Hmm you're right we'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants