mattjohnsonpint / TimeZoneNames

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

TZNames.GetAbbreviationsForTimeZone() for 'nb-NO' throws System.Exception: Could not find a language with code nb-NO #75

Open linusswanbergpolestar opened 2 years ago

linusswanbergpolestar commented 2 years ago

Happens for versions 5.0.0 and 5.0.1

Works fine for version 4.2.0

mattjohnsonpint commented 2 years ago

Hmmm.. I'll have to investigate further. Thanks.

mattjohnsonpint commented 1 year ago

Indeed, this is still happening on 6.0.0.

var results = TimeZoneNames.TZNames.GetNamesForTimeZone("America/Los_Angeles", "nb-NO");
Console.WriteLine(results.Generic);
Unhandled exception. System.Exception: Could not find a language with code nb-NO
   at TimeZoneNames.TZNames.GetLanguageKey(String languageCode, Boolean forDisplayNames)
   at TimeZoneNames.TZNames.GetNamesForTimeZone(String timeZoneId, String languageCode)
   at Program.<Main>$(String[] args) in Program.cs:line 1
bmrfvr commented 8 months ago

I believe this issue would be fixed by my PR: https://github.com/mattjohnsonpint/TimeZoneNames/pull/104