Is there anything that reduces Olson’s timezone list in a readable format for the user interface (like on Google Calendar)?

I am writing an application prompting the user to select the time zone. I get my list of time zones from the Olson database (via NodaTime), but this is a massive list with many backup entries, at least for my purposes.

When you create an event in Google Calendar, you can select the time zone from a relatively small list with an order by country where necessary. I would like to be able to achieve something as simple as without creating a separate database, which this person does .

Since I write this in C # MVC plus JavaScript in the interface, I am looking for a library in any of these languages, which gives me a small list in a user-friendly format that I could display in a drop-down list. Is there such a thing or should I create my own and regularly update it, like the example shown in the hyperlink?

+4
source share
1 answer

Two possible answers here:

  • Information from the zone.tab file. How this happens, only today, another member sent a list with hg clone , which uses this data. I have not looked at it yet, but I hope to do it on the weekend - and after a little massage we hopefully got to branch 1.1.

  • Information from CLDR . This allows us to offer an example of a city for presentation to the user - it is intended for this purpose (even if it’s localized, I think). However, you will need to integrate this with Noda Time yourself; we currently do not have code for this, and just accessing the CLDR will take some time.

Sorry that this is not decided out of the box, but we are aware of it and hope to provide an answer over time.

+3
source

Source: https://habr.com/ru/post/1445208/


All Articles