mattjohnsonpint / TimeZoneNames

Provides a complete source of localized time zone names and abbreviations.
MIT License
196 stars 32 forks source link

Need a way to get country and city name(s) for a given IANA time zone identifier #47

Open tomkludy opened 5 years ago

tomkludy commented 5 years ago

I have a need to accept IANA time zones as both input and output within my application. It is not practical for me to change the interfaces to accept country and time zone independently. Moreover, on output, I have a time zone identifier but can't disambiguate it (I.e. if I have "America/Tijuana" or "America/Los_Angeles" I have to show the user more than just "Pacific Time").

I have submitted a pull request (https://github.com/mj1856/TimeZoneNames/pull/46) with an implementation that can allow a caller to display extended information (countries and city) about the time zone.

I wasn't sure if you pay close attention to the pull requests, or if it would be better to initiate a discussion within an issue 😄

tomkludy commented 5 years ago

Hi, just touching base again on this issue. Any feedback on the issue or on the pull request?

Thanks!

tomkludy commented 5 years ago

I suspect you are very busy and haven't had a chance to look at it closely? I would like to get your feedback on this, and whether it could be considered for inclusion into the library.

Alternatively, if you have any other suggestions for ways to display a stored time zone value, in a meaningful, human-readable and localized way? For example, with input of "America/Sao_Paulo" and locale "pt-BR" then I want to display "Horário de Brasília (São Paulo)".

I could not find any existing APIs in the library to get the localized string (country name + city name) necessary to achieve this. But if I am missing something please let me know!

mattjohnsonpint commented 5 years ago

Hi Tom,

Thanks for your contributions! I'm sorry it's taken me so long to get back to you. I have been dealing with some personal matters, and haven't made much time for open source lately.

I will endeavor to put some time to this in the next week or so.

Thanks for your patience. -Matt