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

provide locale to getTimeZones() #78

Open
ofbeaton opened this issue Oct 8, 2020 · 5 comments
Open

provide locale to getTimeZones() #78

ofbeaton opened this issue Oct 8, 2020 · 5 comments

Comments

@ofbeaton
Copy link

ofbeaton commented Oct 8, 2020

It would be nice to be able to provide the locale to getTimeZones() so that we can get the timezone strings in the language of the user. Right now it is hardcoded to English (and a specific one) which means this library cannot be used to populate tz pickers when displaying a UI in another language.

https://github.com/vvo/tzdb/blob/master/lib/getTimeZones.js

@vvo
Copy link
Owner

vvo commented Dec 15, 2020

@ofbeaton Good idea on the paper, not sure how if it would work given the current code so your best bet is to try it by forking this repository and then let me know.

I am interested in this feature yes and hope you can find a way to implement it!

Let me know :)

@ofbeaton
Copy link
Author

I mean a start might be to allow the user to pass in the locale in a backwards compatible way...

export default function getTimeZones(locale = "en-US") {

But obviously more work would need to be done... Sorry if this is too obvious.

@vvo
Copy link
Owner

vvo commented Dec 16, 2020

@ofbeaton Yep that would work as a start, again I am up for the feature but I won't implement it myself as I do not need it at the moment. But you're welcome to try it and open a PR if you see it working well.

Thanks!

@MohamedHegab
Copy link

Any luck @ofbeaton as I need the same issue right now

@sunny7899
Copy link

Any update on this bug? Are we getting the improvement in any release? I need this also.

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

No branches or pull requests

4 participants