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 does not support 'Europe/Kyiv' timezone #1342

Closed
jasonblickhan opened this issue Mar 11, 2024 · 2 comments
Closed

Intl.DateTimeFormat does not support 'Europe/Kyiv' timezone #1342

jasonblickhan opened this issue Mar 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jasonblickhan
Copy link

Bug Description

It appears that the Europe/Kiev timezone has been renamed to Europe/Kyiv as of March 10, 2022 (per the IANA Database changelog).

Currently, the following code:

Intl.DateTimeFormat('en', {timeZone: 'Europe/Kyiv'}).format(new Date());

produces a crash with this error: com.facebook.hermes.intl.JSRangeErrorException: Invalid timezone name!

We are using the @formatjs polyfill on iOS which supports both IANA timezones while Hermes' Intl only looks to be supporting the old Europe/Kiev timezone.

Hermes git revision (if applicable):
React Native version: 0.72.8
Platform: Android
OS:

Steps To Reproduce

Attempt to format using the Europe/Kyiv timezone on Android using Hermes' Intl library.

Intl.DateTimeFormat('en', {timeZone: 'Europe/Kyiv'}).format(new Date());

The Expected Behavior

It should correctly format the date rather than crash.

@jasonblickhan jasonblickhan added the bug Something isn't working label Mar 11, 2024
@tmikov
Copy link
Contributor

tmikov commented Mar 11, 2024

Hermes does not have its own timezone table, it uses whatever is provided by the OS.

@tmikov
Copy link
Contributor

tmikov commented Mar 11, 2024

Just tried it on MacOS, which presumably has the latest timezones, works as expected.

@tmikov tmikov closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants