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

Add methods to expose country-to-zone mapping and other meta data #255

Open
kashifshamaz21 opened this issue Mar 16, 2015 · 2 comments
Open
Labels

Comments

@kashifshamaz21
Copy link

The official IANA timezone data src has information about which zones are used in a country and vice versa. It also has information about zone aliases(called as "links"). These are useful pieces of information for better handling of timezones.
For example: A user can be shown a list of countries to select from, and based on the chosen countries, a second list of zones used in that country can be pre-populated. To achieve such a functionality, a mapping between Countries-->Zones is needed.
This requires parsing of following files from the IANA tz data:

  1. iso3166.tab: This file can be parsed to create the country-code to country map.
  2. zone.tab: This file can be parsed to create the map between countries to timezone ids.

This type of functionality was added to moment-timezone library, so that can be used as a reference point if need be. (https://github.com/moment/moment-timezone/blob/develop/tasks/data-meta.js)
(https://github.com/moment/moment-timezone/blob/develop/data/meta/latest.json)
@jodastephen Thoughts?

@jodastephen
Copy link
Member

Some of this was covered in the Joda-Time-I18N project. Its not been updated in years, but could be a useful base. Adding this to the core of Joda-Time seems like overkill.

@irfn
Copy link

irfn commented Apr 5, 2015

@jodastephen Using a single source of timezone data is important in an application and for a java application, joda seems appropriate. Any links such as location info should change whenever core timezone info changes. From this perspective i see the need for a single library to be the source for this.
i18n is a one of effort to get the translations and locale specific intricacies nailed down and i doubt the library owner/community would appreciate needing a release whenever a location decides to change their timezone. If you dont deem this change fit for joda itself, we may need a new small library.

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

Successfully merging a pull request may close this issue.

3 participants