-
Notifications
You must be signed in to change notification settings - Fork 837
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
Adding new grunt task data:timezones
to create list of timezones, with an additional info: countryMap.
#161
Conversation
…ith an additional info: countryMap. This info can be used to group timezones based on countries. Also, this will build the timezone list from `zone1970.tab` instead of the deprecated version `zone.tab` which the library currently uses.
This is looking good, thanks for your help with it! I think we can just modify the I think we can also rearrange the data a bit so it is more optimal for the common use cases. What about something like this? {
countries: {
US : {
name: "United States",
abbr: "US",
zones: ["America/Los_Angeles", "America/New_York"]
},
FR : {
name: "France",
abbr: "FR",
zones: ["Europe/Paris"]
},
...
},
zones: {
"America/Los_Angeles" : {
name: "America/Los_Angeles",
latitude: 34.0522,
longitude: -117.7572,
countries: ["US"],
comments: "Pacific Time"
},
...
}
} |
1. Pick "zone1970.tab" as its input source if available, defaults to zone.tab. (until 'tzdata2014f', only zone.tab was available, but now its the deprecated version) 2. Output JSON of this task now has two hashes: "countries" and "zones" to facilitate consumers to deal much better with showing timezone choices.
…data-meta" grunt task.
@timrwood Thanks for the quick review, and yes even i was thinking on silmilar lines for the json structure, but didn't want to add breaking changes if others were already consuming the metadata json. But now i have gone ahead and modified the output JSON structure to have two hashes: This set of commits should fix #158, #159, #160. Questions:
|
Looking good! I rebased your commits down to one and made a couple edits. Instead of prefixing I think we'll have to do a minor version bump for this change and note the breaking changes in the changelog. I'll rebuild the metadata files for all the releases this year and push to that other PR. |
To consume the meta data, would require utility functions like: |
Adding new grunt task data:timezones to create list of timezones, with an additional info: countryMap.
This should resolve the ticket raised at #158
Use-case:
a) Select a country from list of countries (Menu 1)
b) Populate the next menu with list of timezones used in the country selected in Menu 1
Ideally, we can just replace the grunt task
data:meta
with the one added in this commitdata:timezones
.The new task creates a timezones-list.json file which is using data frm zone1970.tab, and has additional property for each zone. So its not removing any of the properties that were being added by the
data:meta
task.