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

Support of IANA timezones #222

Open
s-aleinik opened this issue Jun 14, 2023 · 1 comment
Open

Support of IANA timezones #222

s-aleinik opened this issue Jun 14, 2023 · 1 comment
Assignees
Labels
feature request New feature or request

Comments

@s-aleinik
Copy link

Why it is needed?

Hi!
I was not sure if it's a feature request or a bug report, but here it is:

On our project we using react-native-localize together with date-fns-tz. And we have faced the problem during last review by apple.

I have opened issue for date-fns-tz repo previously and here's their response: marnusw/date-fns-tz#241

After this long intro my question is: is it possible to add support for getTimeZone function to return the time zone in a given format (INAA, for example). In order to prevent unexpected crashed and improve UX of date formatting.

Possible implementation

Provide optional value of format to getTimeZone function. And add mapping of aliases to zone ID according to https://nodatime.org/timezones

Code sample

No response

@s-aleinik s-aleinik added the feature request New feature or request label Jun 14, 2023
@zoontek
Copy link
Owner

zoontek commented Jun 25, 2023

@s-aleinik Currently, this returns NSTimeZone name property.

You can find additional informations here:

Time zone database entries such as “America/Los_Angeles” are IDs, not names. An example of a time zone name is “Pacific Daylight Time”. Although many NSTimeZone symbols include the word “name”, they actually refer to IDs.

I also found this article with some kind of solution.

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

No branches or pull requests

2 participants