-
Notifications
You must be signed in to change notification settings - Fork 834
Add Country name & country code to zone names #158
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
Comments
This data is also available here. https://github.com/moment/moment-timezone/blob/develop/data/meta/latest.json |
@timrwood Thanks for telling about this.. Because of problem a) with the meta/latest.json, i'm currently thinking about having a script to parse the info from IANA data files, to construct a JSON which can serve this purpose. |
@timrwood Now that we have something going for this feature, have been thinking on how we can make this a part of the library itself.
we can add the countries hash from the meta-data to this. And the countries array to every zone. (merging metadata with the timezone data)
With the packed data in above format, some very useful APIs can be added:
The abbr and offset in the above hash can be easily determined as follows
I'm willing to put my hand up for adding all the "packing/unpacking" as well as the new APIs for this. |
Closed with #162 |
Moment Timezone currently provides a list of zone names via this API:
moment.tz.names();
But when a list of choices is to be displayed to end-user, a better selection experience would be to have a two-step selection:
Ex: Google calendar timezone selection
To achieve this, the zones list that moment timezone provides, needs additional information about the countries in which it is used.
This bit of info is publicly available in the IANA data repo
The text was updated successfully, but these errors were encountered: