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

Need main zones list without based on cities #424

Closed
mallikarjuna909 opened this issue Nov 27, 2016 · 1 comment
Closed

Need main zones list without based on cities #424

mallikarjuna909 opened this issue Nov 27, 2016 · 1 comment

Comments

@mallikarjuna909
Copy link

I need list of timezones which are based main time zone list. The dropdown with cities taking long list, i don't need every city's timezone.

Is there any way in moment timezone?

@mattjohnsonpint
Copy link
Contributor

Moment-timezone doesn't list every city in the world. It simply implements the IANA time zone database with support for all valid time zone identifiers. Time zones are typically identified by the city with the largest population in the geographic region where the time zone is in effect.

There is some discussion of adding some filters to only show modern canonical zones in #227. However, these would be the city based zone identifiers. For example, the Pacific time zone in the US has a canonical identifier of America/Los_Angeles. The filter would remove its alias, US/Pacific.

We have no plans to add support for any other non-tzdb aliases, or functionality for producing a reduced list. However, you can do this yourself by deciding which zones you are interested in and keeping a simple key/value pair. For example, if you only care about the USA and only use English names, you could do something like this:

var zones = {
    "Eastern": "America/New_York",
    "Central": "America/Chicago",
    "Mountain": "America/Denver",
    "Arizona": "America/Phoenix",
    "Pacific": "America/Los_Angeles",
    "Alaska": "America/Anchorage",
    "Aleutian": "America/Adak",
    "Hawaii": "Pacific/Honolulu"
};

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

2 participants