mattjohnsonpint / TimeZoneNames

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

Handle CLDR fallback rules properly #12

Open mattjohnsonpint opened 8 years ago

mattjohnsonpint commented 8 years ago

CLDR defines the rules for time zone names here: http://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names

We are not currently fully compliant. Specifically, consider failing unit test:

[Fact]
public void Can_Get_Names_For_CA_Pacific_From_MX()
{
    var names = TimeZoneNames.GetNamesForTimeZone("America/Vancouver", "en-MX");

    Assert.Equal("Pacific Time (Canada)", names.Generic);
    Assert.Equal("Pacific Standard Time (Canada)", names.Standard);
    Assert.Equal("Pacific Daylight Time (Canada)", names.Daylight);
}