diff --git a/docs/design/features/globalization-hybrid-mode.md b/docs/design/features/globalization-hybrid-mode.md index 7f7b3bba2c03b..373804adfd9ff 100644 --- a/docs/design/features/globalization-hybrid-mode.md +++ b/docs/design/features/globalization-hybrid-mode.md @@ -272,6 +272,61 @@ Using `IgnoreNonSpace` for these two with `HybridGlobalization` off, also return new CultureInfo("de-DE").CompareInfo.IndexOf("strasse", "stra\u00DFe", 0, CompareOptions.IgnoreNonSpace); // 0 or -1 ``` +**Calandars** + +Affected public APIs: +- DateTimeFormatInfo.AbbreviatedDayNames +- DateTimeFormatInfo.GetAbbreviatedDayName() +- DateTimeFormatInfo.AbbreviatedMonthGenitiveNames +- DateTimeFormatInfo.AbbreviatedMonthNames +- DateTimeFormatInfo.GetAbbreviatedMonthName() +- DateTimeFormatInfo.AMDesignator +- DateTimeFormatInfo.CalendarWeekRule +- DateTimeFormatInfo.DayNames +- DateTimeFormatInfo.GetDayName +- DateTimeFormatInfo.GetAbbreviatedEraName() +- DateTimeFormatInfo.GetEraName() +- DateTimeFormatInfo.FirstDayOfWeek +- DateTimeFormatInfo.FullDateTimePattern +- DateTimeFormatInfo.LongDatePattern +- DateTimeFormatInfo.LongTimePattern +- DateTimeFormatInfo.MonthDayPattern +- DateTimeFormatInfo.MonthGenitiveNames +- DateTimeFormatInfo.MonthNames +- DateTimeFormatInfo.GetMonthName() +- DateTimeFormatInfo.NativeCalendarName +- DateTimeFormatInfo.PMDesignator +- DateTimeFormatInfo.ShortDatePattern +- DateTimeFormatInfo.ShortestDayNames +- DateTimeFormatInfo.GetShortestDayName() +- DateTimeFormatInfo.ShortTimePattern +- DateTimeFormatInfo.YearMonthPattern + + +The Hybrid responses may differ because they use Web API functions. To better ilustrate the mechanism we provide an example for each endpoint. All exceptions cannot be listed, for reference check the response of specific version of Web API on your host. +| **API** | **Functions used** | **Example of difference for locale** | **non-Hybrid** | **Hybrid** | +|:-----------------------------:|:----------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------:|:------------------:|:-----------------:| +| AbbreviatedDayNames | `Date.prototype.toLocaleDateString(locale, { weekday: "short" })` | en-CA | Sun. | Sun | +| AbbreviatedMonthGenitiveNames | `Date.prototype.toLocaleDateString(locale, { month: "short", day: "numeric"})` | kn-IN | ಆಗ | ಆಗಸ್ಟ್ | +| AbbreviatedMonthNames | `Date.prototype.toLocaleDateString(locale, { month: "short" })` | lt-LT | saus. | 01 | +| AMDesignator | `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h12"})`; `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h24"})` | sr-Cyrl-RS | пре подне | AM | +| CalendarWeekRule | `Intl.Locale.prototype.getWeekInfo().minimalDay` | none | - | - | +| DayNames | `Date.prototype.toLocaleDateString(locale, { weekday: "long" })` | none | - | - | +| GetAbbreviatedEraName() | `Date.prototype.toLocaleDateString(locale, { era: "narrow" })` | bn-IN | খৃষ্টাব্দ | খ্রিঃ | +| GetEraName() | `Date.prototype.toLocaleDateString(locale, { era: "short" })` | vi-VI | sau CN | CN | +| FirstDayOfWeek | `Intl.Locale.prototype.getWeekInfo().firstDay` | zn-CN | Sunday | Monday | +| FullDateTimePattern | `LongDatePattern` and `LongTimePattern` | - | | | +| LongDatePattern | `Intl.DateTimeFormat(locale, { weekday: "long", year: "numeric", month: "long", day: "numeric"}).format(date)` | en-BW | dddd, dd MMMM yyyy | dddd, d MMMM yyyy | +| LongTimePattern | `Intl.DateTimeFormat(locale, { timeStyle: "medium" })` | zn-CN | tth:mm:ss | HH:mm:ss | +| MonthDayPattern | `Date.prototype.toLocaleDateString(locale, { month: "long", day: "numeric"})` | en-PH | d MMMM | MMMM d | +| MonthGenitiveNames | `Date.prototype.toLocaleDateString(locale, { month: "long", day: "numeric"})` | ca-AD | de gener | gener | +| MonthNames | `Date.prototype.toLocaleDateString(locale, { month: "long" })` | el-GR | Ιανουαρίου | Ιανουάριος | +| NativeCalendarName | `Intl.Locale.prototype.getCalendars()` | for all locales it has English names | Gregorian Calendar | gregory | +| PMDesignator | `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h12"})`; `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h24"})` | mr-IN | म.उ. | PM | +| ShortDatePattern | `Date.prototype.toLocaleDateString(locale, {dateStyle: "short"})` | en-CH | dd.MM.yyyy | dd/MM/yyyy | +| ShortestDayNames | `Date.prototype.toLocaleDateString(locale, { weekday: "narrow" })` | none | - | - | +| ShortTimePattern | `Intl.DateTimeFormat(locale, { timeStyle: "medium" })` | bg-BG | HH:mm | H:mm | +| YearMonthPattern | `Date.prototype.toLocaleDateString(locale, { year: "numeric", month: "long" })` | ar-SA | MMMM yyyy | MMMM yyyy g | ### OSX diff --git a/src/libraries/Common/src/Interop/Browser/Interop.Calendar.cs b/src/libraries/Common/src/Interop/Browser/Interop.Calendar.cs new file mode 100644 index 0000000000000..2a7b1d02ad21a --- /dev/null +++ b/src/libraries/Common/src/Interop/Browser/Interop.Calendar.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Globalization; +using System.Runtime.CompilerServices; + +internal static partial class Interop +{ + internal static unsafe partial class JsGlobalization + { + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern unsafe int GetCalendarInfo(in string culture, CalendarId calendarId, char* buffer, int bufferLength, out int exceptionalResult, out object result); + } +} diff --git a/src/libraries/Common/src/Interop/Browser/Interop.Locale.cs b/src/libraries/Common/src/Interop/Browser/Interop.Locale.cs new file mode 100644 index 0000000000000..c882d88afac25 --- /dev/null +++ b/src/libraries/Common/src/Interop/Browser/Interop.Locale.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +internal static partial class Interop +{ + internal static unsafe partial class JsGlobalization + { + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern unsafe int GetCultureInfo(in string culture, char* buffer, int bufferLength, out int exceptionalResult, out object result); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern unsafe int GetFirstDayOfWeek(in string culture, out int exceptionalResult, out object result); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern unsafe int GetFirstWeekOfYear(in string culture, out int exceptionalResult, out object result); + } +} diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index da450c017006b..c0bbcaa90df2c 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -366,6 +366,7 @@ public static string GetDistroVersionString() public static bool IsNotHybridGlobalizationOnBrowser => !IsHybridGlobalizationOnBrowser; public static bool IsNotInvariantGlobalization => !IsInvariantGlobalization; public static bool IsIcuGlobalization => ICUVersion > new Version(0, 0, 0, 0); + public static bool IsIcuGlobalizationAndNotHybridOnBrowser => IsIcuGlobalization && IsNotHybridGlobalizationOnBrowser; public static bool IsNlsGlobalization => IsNotInvariantGlobalization && !IsIcuGlobalization; public static bool IsSubstAvailable diff --git a/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj b/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj new file mode 100644 index 0000000000000..5b89836376408 --- /dev/null +++ b/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj @@ -0,0 +1,109 @@ + + + $(NetCoreAppCurrent)-browser + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/libraries/System.Globalization.Calendars/tests/System/Globalization/CalendarTestBase.cs b/src/libraries/System.Globalization.Calendars/tests/System/Globalization/CalendarTestBase.cs index 62e1b36006987..c99b883aa7728 100644 --- a/src/libraries/System.Globalization.Calendars/tests/System/Globalization/CalendarTestBase.cs +++ b/src/libraries/System.Globalization.Calendars/tests/System/Globalization/CalendarTestBase.cs @@ -430,7 +430,10 @@ public void GetEra_Invalid_ThrowsArgumentOutOfRangeException() Assert.All(DateTime_TestData(calendar), dt => { // JapaneseCalendar throws on ICU, but not on NLS - if ((calendar is JapaneseCalendar && PlatformDetection.IsNlsGlobalization) || calendar is HebrewCalendar || calendar is TaiwanLunisolarCalendar || calendar is JapaneseLunisolarCalendar) + if ((calendar is JapaneseCalendar && PlatformDetection.IsNlsGlobalization) || + calendar is HebrewCalendar || + calendar is TaiwanLunisolarCalendar || + calendar is JapaneseLunisolarCalendar) { calendar.GetEra(dt); } diff --git a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs index f1af25e43ba69..37175600777b4 100644 --- a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs +++ b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCtor.cs @@ -442,7 +442,7 @@ public void TestCreationWithTemporaryLCID(int lcid) [InlineData("de-DE-u-co-phonebk-t-xx", "de-DE-t-xx", "de-DE-t-xx_phoneboo")] [InlineData("de-DE-u-co-phonebk-t-xx-u-yy", "de-DE-t-xx-u-yy", "de-DE-t-xx-u-yy_phoneboo")] [InlineData("de-DE", "de-DE", "de-DE")] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalization))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalizationAndNotHybridOnBrowser))] public void TestCreationWithMangledSortName(string cultureName, string expectedCultureName, string expectedSortName) { CultureInfo ci = CultureInfo.GetCultureInfo(cultureName); @@ -457,7 +457,7 @@ public void TestCreationWithMangledSortName(string cultureName, string expectedC [InlineData("qps-plocm", "qps-PLOCM")] // ICU normalize this name to "qps--plocm" which we normalize it back to "qps-plocm" [InlineData("zh_CN", "zh_cn")] [InlineData("km_KH", "km_kh")] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalization), nameof(PlatformDetection.IsNotWindowsServerCore))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalizationAndNotHybridOnBrowser), nameof(PlatformDetection.IsNotWindowsServerCore))] public void TestCreationWithICUNormalizedNames(string cultureName, string expectedCultureName) { CultureInfo ci = CultureInfo.GetCultureInfo(cultureName); diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAMDesignator.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAMDesignator.cs index 5c284c5ef872e..0eeb6d9c4a738 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAMDesignator.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAMDesignator.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Xunit; +using System.Collections.Generic; namespace System.Globalization.Tests { @@ -13,6 +14,204 @@ public void AMDesignator_GetInvariantInfo_ReturnsExpected() Assert.Equal("AM", DateTimeFormatInfo.InvariantInfo.AMDesignator); } + public static IEnumerable AMDesignator_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "ص" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "ጥዋት" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "пр.об." }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "a.\u00A0m." }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "a.\u00A0m." }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "dop." }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "π.μ." }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "π.μ." }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "AM" }; // am + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "a.\u00A0m." }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "a.\u00A0m." }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "a.\u00A0m." }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "قبل‌ازظهر" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "ap." }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "לפנה״צ" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "am" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "de." }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "午前" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "ಪೂರ್ವಾಹ್ನ" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "오전" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "priešpiet" }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "priekšpusdienā" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "AM" }; // म.पू. + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "PG" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "PG" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "PG" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "da manhã" }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "a.m." }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "dop." }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "AM" }; // пре подне + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "AM" }; // pre podne + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "fm" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "fm" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "முற்பகல்" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "முற்பகல்" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "முற்பகல்" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "முற்பகல்" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "AM" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "ก่อนเที่ยง" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "ÖÖ" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "ÖÖ" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "дп" }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "SA" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "上午" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "上午" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "上午" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "上午" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "上午" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(AMDesignator_Get_TestData_HybridGlobalization))] + public void AMDesignator_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string value) + { + Assert.Equal(value, format.AMDesignator); + } + [Theory] [InlineData("")] [InlineData("AA")] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedDayNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedDayNames.cs index 1476370eeab98..a597272f7492c 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedDayNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedDayNames.cs @@ -28,6 +28,71 @@ public static IEnumerable AbbreviatedDayNames_Set_TestData() yield return new object[] { new string[] { "", "", "", "", "", "", "" } }; } + public static IEnumerable AbbreviatedDayNames_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "እሑድ", "ሰኞ", "ማክሰ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "нд", "пн", "вт", "ср", "чт", "пт", "сб" } }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, new string[] { "রবি", "সোম", "মঙ্গল", "বুধ", "বৃহস্পতি", "শুক্র", "শনি" } }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, new string[] { "dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds." } }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "ne", "po", "út", "st", "čt", "pá", "so" } }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, new string[] { "søn.", "man.", "tirs.", "ons.", "tors.", "fre.", "lør." } }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, new string[] { "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" } }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, new string[] { "Κυρ", "Δευ", "Τρί", "Τετ", "Πέμ", "Παρ", "Σάβ" } }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, new string[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } }; // should be with dots + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "dom", "lun", "mar", "mié", "jue", "vie", "sáb" } }; // should be with dots like all "es-*" + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "P", "E", "T", "K", "N", "R", "L" } }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "su", "ma", "ti", "ke", "to", "pe", "la" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Lin", "Lun", "Mar", "Miy", "Huw", "Biy", "Sab" } }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, new string[] { "dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam." } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "રવિ", "સોમ", "મંગળ", "બુધ", "ગુરુ", "શુક્ર", "શનિ" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "יום א׳", "יום ב׳", "יום ג׳", "יום ד׳", "יום ה׳", "יום ו׳", "שבת" } }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, new string[] { "ned", "pon", "uto", "sri", "čet", "pet", "sub" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "V", "H", "K", "Sze", "Cs", "P", "Szo" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" } }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, new string[] { "dom", "lun", "mar", "mer", "gio", "ven", "sab" } }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, new string[] { "dom", "lun", "mar", "mer", "gio", "ven", "sab" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "日", "月", "火", "水", "木", "金", "土" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಭಾನು", "ಸೋಮ", "ಮಂಗಳ", "ಬುಧ", "ಗುರು", "ಶುಕ್ರ", "ಶನಿ" } }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "일", "월", "화", "수", "목", "금", "토" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "sk", "pr", "an", "tr", "kt", "pn", "št" } }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "Svētd.", "Pirmd.", "Otrd.", "Trešd.", "Ceturtd.", "Piektd.", "Sestd." } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ഞായർ", "തിങ്കൾ", "ചൊവ്വ", "ബുധൻ", "വ്യാഴം", "വെള്ളി", "ശനി" } }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, new string[] { "रवि", "सोम", "मंगळ", "बुध", "गुरु", "शुक्र", "शनि" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "Ahd", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab" } }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, new string[] { "søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør." } }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, new string[] { "zo", "ma", "di", "wo", "do", "vr", "za" } }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob." } }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, new string[] { "dom.", "seg.", "ter.", "qua.", "qui.", "sex.", "sáb." } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "domingo", "segunda", "terça", "quarta", "quinta", "sexta", "sábado" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "dum.", "lun.", "mar.", "mie.", "joi", "vin.", "sâm." } }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, new string[] { "вс", "пн", "вт", "ср", "чт", "пт", "сб" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "ne", "po", "ut", "st", "št", "pi", "so" } }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, new string[] { "ned.", "pon.", "tor.", "sre.", "čet.", "pet.", "sob." } }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, new string[] { "нед", "пон", "уто", "сре", "чет", "пет", "суб" } }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, new string[] { "ned", "pon", "uto", "sre", "čet", "pet", "sub" } }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, new string[] { "sön", "mån", "tis", "ons", "tors", "fre", "lör" } }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, new string[] { "sön", "mån", "tis", "ons", "tors", "fre", "lör" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஞாயி.", "திங்.", "செவ்.", "புத.", "வியா.", "வெள்.", "சனி" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "ఆది", "సోమ", "మంగళ", "బుధ", "గురు", "శుక్ర", "శని" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส." } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "нд", "пн", "вт", "ср", "чт", "пт", "сб" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "CN", "Th 2", "Th 3", "Th 4", "Th 5", "Th 6", "Th 7" } }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, new string[] { "周日", "周一", "周二", "周三", "周四", "周五", "周六" } }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(AbbreviatedDayNames_Get_TestData_HybridGlobalization))] + public void AbbreviatedDayNames_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string[] expected) + { + Assert.Equal(expected, format.AbbreviatedDayNames); + } + [Theory] [MemberData(nameof(AbbreviatedDayNames_Set_TestData))] public void AbbreviatedDayNames_Set_GetReturnsExpected(string[] value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthGenitiveNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthGenitiveNames.cs index 4e49bdd154ee6..1a6c6f7a84826 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthGenitiveNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthGenitiveNames.cs @@ -8,6 +8,204 @@ namespace System.Globalization.Tests { public class DateTimeFormatInfoAbbreviatedMonthGenitiveNames { + + public static IEnumerable AbbreviatedMonthGenitiveNames_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة", "" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "ጃንዩ", "ፌብሩ", "ማርች", "ኤፕሪ", "ሜይ", "ጁን", "ጁላይ", "ኦገስ", "ሴፕቴ", "ኦክቶ", "ኖቬም", "ዲሴም", "" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "" } }; //"яну", "фев", "март", "апр", "май", "юни", "юли", "авг", "сеп", "окт", "ное", "дек", "" + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, new string[] { "জানু", "ফেব", "মার্চ", "এপ্রি", "মে", "জুন", "জুল", "আগ", "সেপ", "অক্টো", "নভে", "ডিসে", "" } }; // "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, new string[] { "জানু", "ফেব", "মার্চ", "এপ্রি", "মে", "জুন", "জুল", "আগ", "সেপ্টেঃ", "অক্টোঃ", "নভেঃ", "ডিসেঃ", "" } }; // "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, new string[] { "gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des.", "" } }; // "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des.", "" + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, new string[] { "gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des.", "" } }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro", "" } }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, new string[] { "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, new string[] { "Jän.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, new string[] { "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, new string[] { "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, new string[] { "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, new string[] { "Jän.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, new string[] { "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, new string[] { "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez.", "" } }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, new string[] { "Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ", "" } }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, new string[] { "Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ", "" } }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Jun", "Jul", .., "Sep" + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; // "Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec.", "" + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", "" + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", "" + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", "" + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "jaan", "veebr", "märts", "apr", "mai", "juuni", "juuli", "aug", "sept", "okt", "nov", "dets", "" } }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "tammik.", "helmik.", "maalisk.", "huhtik.", "toukok.", "kesäk.", "heinäk.", "elok.", "syysk.", "lokak.", "marrask.", "jouluk.", "" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Ene", "Peb", "Mar", "Abr", "May", "Hun", "Hul", "Ago", "Set", "Okt", "Nob", "Dis", "" } }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juill.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "જાન્યુ", "ફેબ્રુ", "માર્ચ", "એપ્રિલ", "મે", "જૂન", "જુલાઈ", "ઑગસ્ટ", "સપ્ટે", "ઑક્ટો", "નવે", "ડિસે", "" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "ינו׳", "פבר׳", "מרץ", "אפר׳", "מאי", "יוני", "יולי", "אוג׳", "ספט׳", "אוק׳", "נוב׳", "דצמ׳", "" } }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, new string[] { "जन॰", "फ़र॰", "मार्च", "अप्रैल", "मई", "जून", "जुल॰", "अग॰", "सित॰", "अक्तू॰", "नव॰", "दिस॰", "" } }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, new string[] { "sij", "velj", "ožu", "tra", "svi", "lip", "srp", "kol", "ruj", "lis", "stu", "pro", "" } }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, new string[] { "sij", "velj", "ožu", "tra", "svi", "lip", "srp", "kol", "ruj", "lis", "stu", "pro", "" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "jan.", "febr.", "márc.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, new string[] { "gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic", "" } }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, new string[] { "gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic", "" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಜನವರಿ", "ಫೆಬ್ರವರಿ", "ಮಾರ್ಚ್", "ಏಪ್ರಿ", "ಮೇ", "ಜೂನ್", "ಜುಲೈ", "ಆಗಸ್ಟ್", "ಸೆಪ್ಟೆಂ", "ಅಕ್ಟೋ", "ನವೆಂ", "ಡಿಸೆಂ", "" } }; //"ಜನವರಿ", "ಫೆಬ್ರವರಿ", "ಮಾರ್ಚ್", "ಏಪ್ರಿ", "ಮೇ", "ಜೂನ್", "ಜುಲೈ", "ಆಗ", "ಸೆಪ್ಟೆಂ", "ಅಕ್ಟೋ", "ನವೆಂ", "ಡಿಸೆಂ", "" + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월", "" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "" } }; // "saus.", "vas.", "kov.", "bal.", "geg.", "birž.", "liep.", "rugp.", "rugs.", "spal.", "lapkr.", "gruod." + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "janv.", "febr.", "marts", "apr.", "maijs", "jūn.", "jūl.", "aug.", "sept.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ജനു", "ഫെബ്രു", "മാർ", "ഏപ്രി", "മേയ്", "ജൂൺ", "ജൂലൈ", "ഓഗ", "സെപ്റ്റം", "ഒക്ടോ", "നവം", "ഡിസം", "" } }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, new string[] { "जाने", "फेब्रु", "मार्च", "एप्रि", "मे", "जून", "जुलै", "ऑग", "सप्टें", "ऑक्टो", "नोव्हें", "डिसें", "" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis", "" } }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis", "" } }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis", "" } }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, new string[] { "jan.", "feb.", "mar.", "apr.", "mai", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "des.", "" } }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, new string[] { "jan.", "feb.", "mar.", "apr.", "mai", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "des.", "" } }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, new string[] { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", "" } }; // "jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec.", "" + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, new string[] { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", "" } }; // "jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec.", "" + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, new string[] { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", "" } }; // "jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec.", "" + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru", "" } }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, new string[] { "jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez.", "" } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez.", "" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "ian.", "feb.", "mar.", "apr.", "mai", "iun.", "iul.", "aug.", "sept.", "oct.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, new string[] { "янв.", "февр.", "мар.", "апр.", "мая", "июн.", "июл.", "авг.", "сент.", "окт.", "нояб.", "дек.", "" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, new string[] { "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "avg.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, new string[] { "јан", "феб", "мар", "апр", "мај", "јун", "јул", "авг", "сеп", "окт", "нов", "дец", "" } }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "maj", "jun", "jul", "avg", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, new string[] { "jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, new string[] { "jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "జన", "ఫిబ్ర", "మార్చి", "ఏప్రి", "మే", "జూన్", "జులై", "ఆగ", "సెప్టెం", "అక్టో", "నవం", "డిసెం", "" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.", "" } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", "" } }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, new string[] { "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", "" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "січ.", "лют.", "бер.", "квіт.", "трав.", "черв.", "лип.", "серп.", "вер.", "жовт.", "лист.", "груд.", "" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "Thg 1", "Thg 2", "Thg 3", "Thg 4", "Thg 5", "Thg 6", "Thg 7", "Thg 8", "Thg 9", "Thg 10", "Thg 11", "Thg 12", "" } }; // thg + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(AbbreviatedMonthGenitiveNames_Get_TestData_HybridGlobalization))] + public void AbbreviatedMonthGenitiveNames_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string[] expected) + { + Assert.Equal(expected, format.AbbreviatedMonthGenitiveNames); + } + [Fact] public void AbbreviatedMonthGenitiveNames_GetInvariantInfo_ReturnsExpected() { @@ -92,7 +290,11 @@ public void AbbreviatedMonthGenitiveNames_Format_ReturnsExpected() [Fact] public void TestAbbreviatedGenitiveNamesWithAllCultures() { - CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); + // WASM in Hybrid mode does not support NeutralCultures (only "no"), its support is limited to the list: + // https://github.com/dotnet/icu/blob/dotnet/main/icu-filters/icudt_wasm.json + CultureInfo[] cultures = PlatformDetection.IsHybridGlobalizationOnBrowser ? + CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures) : + CultureInfo.GetCultures(CultureTypes.AllCultures); DateTime dt = new DateTime(2000, 1, 20); foreach (CultureInfo ci in cultures) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthNames.cs index 8ac57d2b29996..7b203324cf3be 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoAbbreviatedMonthNames.cs @@ -11,7 +11,8 @@ public class DateTimeFormatInfoAbbreviatedMonthNames [Fact] public void AbbreviatedMonthNames_GetInvariantInfo_ReturnsExpected() { - Assert.Equal(new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" }, DateTimeFormatInfo.InvariantInfo.AbbreviatedMonthNames); + Assert.Equal(new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" }, + DateTimeFormatInfo.InvariantInfo.AbbreviatedMonthNames); } [Fact] @@ -28,6 +29,204 @@ public static IEnumerable AbbreviatedMonthNames_Set_TestData() yield return new object[] { new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "" } }; } + public static IEnumerable AbbreviatedMonthNames_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة", "" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "ጃንዩ", "ፌብሩ", "ማርች", "ኤፕሪ", "ሜይ", "ጁን", "ጁላይ", "ኦገስ", "ሴፕቴ", "ኦክቶ", "ኖቬም", "ዲሴም", "" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "" } }; // "яну", "фев", "март", "апр", "май", "юни", "юли", "авг", "сеп", "окт", "ное", "дек", "" + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, new string[] { "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" } }; // "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, new string[] { "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেঃ", "অক্টোঃ", "নভেঃ", "ডিসেঃ", "" } }; // BUG. JS returns Genitive even though we expect Nominative; "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, new string[] { "gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des.", "" } }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, new string[] { "gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des.", "" } }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro", "" } }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, new string[] { "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, new string[] { "Jän", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, new string[] { "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, new string[] { "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, new string[] { "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, new string[] { "Jän", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, new string[] { "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, new string[] { "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", "" } }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, new string[] { "Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ", "" } }; // BUG. JS returns Genitive for Greek even though we expect Nominative; "Ιαν", "Φεβ", "Μάρ", "Απρ", "Μάι", "Ιούν", "Ιούλ", "Αύγ", "Σεπ", "Οκτ", "Νοέ", "Δεκ", "" + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, new string[] { "Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ", "" } }; // BUG. + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; // "Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec.", "" + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" } }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "" } }; // "Sep" + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", "" + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", "" + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", "" + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "jaanuar", "veebruar", "märts", "aprill", "mai", "juuni", "juuli", "august", "september", "oktoober", "november", "detsember", "" } }; // "jaan", "veebr", "märts", "apr", "mai", "juuni", "juuli", "aug", "sept", "okt", "nov", "dets", "" + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "tammi", "helmi", "maalis", "huhti", "touko", "kesä", "heinä", "elo", "syys", "loka", "marras", "joulu", "" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Ene", "Peb", "Mar", "Abr", "May", "Hun", "Hul", "Ago", "Set", "Okt", "Nob", "Dis", "" } }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juill.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", "" } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "જાન્યુ", "ફેબ્રુ", "માર્ચ", "એપ્રિલ", "મે", "જૂન", "જુલાઈ", "ઑગસ્ટ", "સપ્ટે", "ઑક્ટો", "નવે", "ડિસે", "" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "ינו׳", "פבר׳", "מרץ", "אפר׳", "מאי", "יוני", "יולי", "אוג׳", "ספט׳", "אוק׳", "נוב׳", "דצמ׳", "" } }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, new string[] { "जन॰", "फ़र॰", "मार्च", "अप्रैल", "मई", "जून", "जुल॰", "अग॰", "सित॰", "अक्तू॰", "नव॰", "दिस॰", "" } }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, new string[] { "sij", "velj", "ožu", "tra", "svi", "lip", "srp", "kol", "ruj", "lis", "stu", "pro", "" } }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, new string[] { "sij", "velj", "ožu", "tra", "svi", "lip", "srp", "kol", "ruj", "lis", "stu", "pro", "" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "jan.", "febr.", "márc.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, new string[] { "gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic", "" } }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, new string[] { "gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic", "" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಜನ", "ಫೆಬ್ರ", "ಮಾರ್ಚ್", "ಏಪ್ರಿ", "ಮೇ", "ಜೂನ್", "ಜುಲೈ", "ಆಗ", "ಸೆಪ್ಟೆಂ", "ಅಕ್ಟೋ", "ನವೆಂ", "ಡಿಸೆಂ", "" } }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월", "" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "" } }; // "saus.", "vas.", "kov.", "bal.", "geg.", "birž.", "liep.", "rugp.", "rugs.", "spal.", "lapkr.", "gruod." + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "janv.", "febr.", "marts", "apr.", "maijs", "jūn.", "jūl.", "aug.", "sept.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ജനു", "ഫെബ്രു", "മാർ", "ഏപ്രി", "മേയ്", "ജൂൺ", "ജൂലൈ", "ഓഗ", "സെപ്റ്റം", "ഒക്ടോ", "നവം", "ഡിസം", "" } }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, new string[] { "जाने", "फेब्रु", "मार्च", "एप्रि", "मे", "जून", "जुलै", "ऑग", "सप्टें", "ऑक्टो", "नोव्हें", "डिसें", "" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis", "" } }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis", "" } }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis", "" } }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des", "" } }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des", "" } }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des", "" } }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, new string[] { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, new string[] { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, new string[] { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru", "" } }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, new string[] { "jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez.", "" } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez.", "" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "ian.", "feb.", "mar.", "apr.", "mai", "iun.", "iul.", "aug.", "sept.", "oct.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, new string[] { "янв.", "февр.", "март", "апр.", "май", "июнь", "июль", "авг.", "сент.", "окт.", "нояб.", "дек.", "" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, new string[] { "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "avg.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, new string[] { "јан", "феб", "мар", "апр", "мај", "јун", "јул", "авг", "сеп", "окт", "нов", "дец", "" } }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, new string[] { "jan", "feb", "mar", "apr", "maj", "jun", "jul", "avg", "sep", "okt", "nov", "dec", "" } }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, new string[] { "jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, new string[] { "jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec.", "" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, new string[] { "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des", "" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, new string[] { "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச.", "" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "జన", "ఫిబ్ర", "మార్చి", "ఏప్రి", "మే", "జూన్", "జులై", "ఆగ", "సెప్టెం", "అక్టో", "నవం", "డిసెం", "" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.", "" } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", "" } }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, new string[] { "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", "" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "січ", "лют", "бер", "кві", "тра", "чер", "лип", "сер", "вер", "жов", "лис", "гру", "" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "Thg 1", "Thg 2", "Thg 3", "Thg 4", "Thg 5", "Thg 6", "Thg 7", "Thg 8", "Thg 9", "Thg 10", "Thg 11", "Thg 12", "" } }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(AbbreviatedMonthNames_Get_TestData_HybridGlobalization))] + public void AbbreviatedMonthNames_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string[] expected) + { + Assert.Equal(expected, format.AbbreviatedMonthNames); + } + [Theory] [MemberData(nameof(AbbreviatedMonthNames_Set_TestData))] public void AbbreviatedMonthNames_Set_GetReturnsExpected(string[] value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs index 2d0bd120bd307..020bb5239bfc5 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs @@ -22,6 +22,196 @@ public static IEnumerable CalendarWeekRule_Get_TestData() // "br-FR" is not presented in Browser's ICU. Let's test ru-RU instead. yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; } + + if (PlatformDetection.IsHybridGlobalizationOnBrowser) + { + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, CalendarWeekRule.FirstDay }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, CalendarWeekRule.FirstDay }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoDayNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoDayNames.cs index 3a3dd9f032ab5..85a88238e5ad5 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoDayNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoDayNames.cs @@ -28,6 +28,63 @@ public static IEnumerable DayNames_Set_TestData() yield return new object[] { new string[] { "", "", "", "", "", "", "" } }; } + public static IEnumerable DayNames_Get_TestData_HybridGlobalization() + { + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "እሑድ", "ሰኞ", "ማክሰኞ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "неделя", "понеделник", "вторник", "сряда", "четвъртък", "петък", "събота" } }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, new string[] { "রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার" } }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, new string[] { "diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte" } }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota" } }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, new string[] { "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" } }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, new string[] { "Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado" } }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, new string[] { "domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado" } }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, new string[] { "domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado" } }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "pühapäev", "esmaspäev", "teisipäev", "kolmapäev", "neljapäev", "reede", "laupäev" } }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Linggo", "Lunes", "Martes", "Miyerkules", "Huwebes", "Biyernes", "Sabado" } }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi" } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "રવિવાર", "સોમવાર", "મંગળવાર", "બુધવાર", "ગુરુવાર", "શુક્રવાર", "શનિવાર" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "יום ראשון", "יום שני", "יום שלישי", "יום רביעי", "יום חמישי", "יום שישי", "יום שבת" } }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, new string[] { "रविवार", "सोमवार", "मंगलवार", "बुधवार", "गुरुवार", "शुक्रवार", "शनिवार" } }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, new string[] { "nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" } }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, new string[] { "domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಭಾನುವಾರ", "ಸೋಮವಾರ", "ಮಂಗಳವಾರ", "ಬುಧವಾರ", "ಗುರುವಾರ", "ಶುಕ್ರವಾರ", "ಶನಿವಾರ" } }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "sekmadienis", "pirmadienis", "antradienis", "trečiadienis", "ketvirtadienis", "penktadienis", "šeštadienis" } }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena" } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ഞായറാഴ്‌ച", "തിങ്കളാഴ്‌ച", "ചൊവ്വാഴ്‌ച", "ബുധനാഴ്‌ച", "വ്യാഴാഴ്‌ച", "വെള്ളിയാഴ്‌ച", "ശനിയാഴ്‌ച" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu" } }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, new string[] { "søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag" } }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, new string[] { "zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag" } }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota" } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "duminică", "luni", "marți", "miercuri", "joi", "vineri", "sâmbătă" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota" } }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, new string[] { "söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஞாயிறு", "திங்கள்", "செவ்வாய்", "புதன்", "வியாழன்", "வெள்ளி", "சனி" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "ఆదివారం", "సోమవారం", "మంగళవారం", "బుధవారం", "గురువారం", "శుక్రవారం", "శనివారం" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์" } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "неділя", "понеділок", "вівторок", "середа", "четвер", "пʼятниця", "субота" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "Chủ Nhật", "Thứ Hai", "Thứ Ba", "Thứ Tư", "Thứ Năm", "Thứ Sáu", "Thứ Bảy" } }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" } }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(DayNames_Get_TestData_HybridGlobalization))] + public void DayNames_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string[] expected) + { + Assert.Equal(expected, format.DayNames); + } + [Theory] [MemberData(nameof(DayNames_Set_TestData))] public void DayNames_Set_GetReturnsExpected(string[] value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFirstDayOfWeek.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFirstDayOfWeek.cs index 4de3d329fac40..290e7905a4390 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFirstDayOfWeek.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFirstDayOfWeek.cs @@ -11,8 +11,201 @@ public class DateTimeFormatInfoFirstDayOfWeek public static IEnumerable FirstDayOfWeek_Get_TestData() { yield return new object[] { DateTimeFormatInfo.InvariantInfo, DayOfWeek.Sunday }; - yield return new object[] { new CultureInfo("en-US", false).DateTimeFormat, DayOfWeek.Sunday }; - yield return new object[] { new CultureInfo("fr-FR", false).DateTimeFormat, DayOfWeek.Monday }; + if (!PlatformDetection.IsHybridGlobalizationOnBrowser) + { + yield return new object[] { new CultureInfo("en-US", false).DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("fr-FR", false).DateTimeFormat, DayOfWeek.Monday }; + } + else + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, DayOfWeek.Saturday }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, DayOfWeek.Monday }; // originally in ICU: Sunday, even though ISO 8601 states: Monday + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, DayOfWeek.Saturday }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, DayOfWeek.Saturday }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, DayOfWeek.Monday }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, DayOfWeek.Monday }; // DayOfWeek.Sunday + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, DayOfWeek.Sunday }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, DayOfWeek.Sunday }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFullDateTimePattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFullDateTimePattern.cs index fa95f52530426..97759781e2c56 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFullDateTimePattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoFullDateTimePattern.cs @@ -24,6 +24,202 @@ public static IEnumerable FullDateTimePattern_Set_TestData() yield return new object[] { "HH:mm:ss dddd, dd MMMM yyyy" }; } + public static IEnumerable FullDateTimePattern_Get_TestData_HybridGlobalization() + { + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "dddd، d MMMM yyyy h:mm:ss tt" }; // dddd، d MMMM yyyy g h:mm:ss tt + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "yyyy MMMM d, dddd h:mm:ss tt" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "dddd, d MMMM yyyy г. H:mm:ss ч." }; // dddd, d MMMM yyyy 'г'. H:mm:ss + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "dddd, d MMMM, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "dddd, d MMMM, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "dddd, d de MMMM de yyyy H:mm:ss" }; // dddd, d MMMM 'de' yyyy H:mm:ss + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "dddd, d de MMMM de yyyy H:mm:ss" }; // dddd, d MMMM 'de' yyyy H:mm:ss + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "dddd d. MMMM yyyy H:mm:ss" }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "dddd den d. MMMM yyyy HH.mm.ss" }; // dddd 'den' d. MMMM yyyy HH.mm.ss + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "dddd d MMMM yyyy h:mm:ss tt" }; // dddd, d MMMM yyyy h:mm:ss tt + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "dddd d MMMM yyyy h:mm:ss tt" }; // dddd, d MMMM yyyy h:mm:ss tt + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "dddd, MMMM d, yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; // dddd, dd MMMM yyyy HH:mm:ss + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; // dddd, dd MMMM yyyy HH:mm:ss + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "dddd, d MMMM yyyy HH.mm.ss" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "dddd, d MMMM yyyy H.mm.ss" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "dddd, d MMMM yyyy H:mm:ss" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "dddd, d MMMM, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; // dddd, d MMMM yyyy h:mm:ss tt + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; // dddd, dd MMMM yyyy HH:mm:ss + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; // dddd, dd MMMM yyyy HH:mm:ss + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "dddd, d de MMMM de yyyy HH:mm:ss" }; // dddd, d 'de' MMMM 'de' yyyy HH:mm:ss + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "dddd, d de MMMM de yyyy H:mm:ss" }; // dddd, d 'de' MMMM 'de' yyyy H:mm:ss + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "dddd, d de MMMM de yyyy HH:mm:ss" }; // dddd, d 'de' MMMM 'de' yyyy H:mm:ss + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "yyyy MMMM d, dddd H:mm:ss" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "dddd d. MMMM yyyy H.mm.ss" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "dddd d MMMM yyyy HH h mm min ss s" }; // dddd d MMMM yyyy HH 'h' mm 'min' ss 's' + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "dddd, d MMMM, yyyy hh:mm:ss tt" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "dddd, d בMMMM yyyy H:mm:ss" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "dddd, d. MMMM yyyy. HH:mm:ss" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "dddd, d. MMMM yyyy. HH:mm:ss" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "yyyy. MMMM d., dddd H:mm:ss" }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "dddd, d MMMM yyyy HH.mm.ss" }; // dddd, dd MMMM yyyy HH.mm.ss + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "yyyy年M月d日dddd H:mm:ss" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "dddd, MMMM d, yyyy hh:mm:ss tt" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "yyyy년 M월 d일 dddd tt h:mm:ss" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "yyyy m. MMMM d d., dddd HH:mm:ss" }; // yyyy 'm'. MMMM d 'd'., dddd HH:mm:ss + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "dddd, yyyy. gada d. MMMM HH:mm:ss" }; // dddd, yyyy. 'gada' d. MMMM HH:mm:ss + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "yyyy, MMMM d, dddd h:mm:ss tt" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "dddd, d MMMM, yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; // dd MMMM yyyy h:mm:ss tt + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "dddd d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "dddd d. MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "dddd, d de MMMM de yyyy HH:mm:ss" }; // dddd, d 'de' MMMM 'de' yyyy HH:mm:ss + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "dddd, d de MMMM de yyyy HH:mm:ss" }; // dddd, d 'de' MMMM 'de' yyyy HH:mm:ss + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "dddd, d MMMM yyyy г. HH:mm:ss" }; // dddd, d MMMM yyyy 'г'. HH:mm:ss + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "dddd d. MMMM yyyy H:mm:ss" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "dddd, d. MMMM yyyy HH:mm:ss" }; // dddd, dd. MMMM yyyy HH:mm:ss + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "dddd, d. MMMM yyyy. HH:mm:ss" }; // dddd, dd. MMMM yyyy. HH:mm:ss + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "dddd, d. MMMM yyyy. HH:mm:ss" }; // dddd, dd. MMMM yyyy. HH:mm:ss + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "dddd, d MMMM, yyyy tt h:mm:ss" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "dddd, d MMMM, yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "dddd, d MMMM, yyyy tt h:mm:ss" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "dddd, d MMMM, yyyy tt h:mm:ss" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "d, MMMM yyyy, dddd h:mm:ss tt" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "ddddที่ d MMMM g yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "d MMMM yyyy dddd h:mm:ss tt" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "d MMMM yyyy dddd HH:mm:ss" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "dddd, d MMMM yyyy р. HH:mm:ss" }; // dddd, d MMMM yyyy 'р'. HH:mm:ss + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "dddd, d MMMM, yyyy HH:mm:ss" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "yyyy年M月d日dddd HH:mm:ss" }; // yyyy年M月d日dddd tth:mm:ss + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "yyyy年M月d日dddd tth:mm:ss" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "yyyy年M月d日dddd tth:mm:ss" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "yyyy年M月d日dddd tth:mm:ss" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "yyyy年M月d日 dddd tth:mm:ss" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(FullDateTimePattern_Get_TestData_HybridGlobalization))] + public void FullDateTimePattern_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string value) + { + Assert.Equal(value, format.FullDateTimePattern); + } + [Theory] [MemberData(nameof(FullDateTimePattern_Set_TestData))] public void FullDateTimePattern_Set_GetReturnsExpected(string value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetAbbreviatedEraName.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetAbbreviatedEraName.cs index a7ba3350cb130..1c46378c2b3d8 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetAbbreviatedEraName.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetAbbreviatedEraName.cs @@ -15,6 +15,197 @@ public static IEnumerable GetAbbreviatedEraName_TestData() yield return new object[] { new DateTimeFormatInfo(), 0, "AD" }; yield return new object[] { new DateTimeFormatInfo(), 1, "AD" }; yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, 1, DateTimeFormatInfoData.JaJPAbbreviatedEraName() }; + + if (PlatformDetection.IsHybridGlobalizationOnBrowser) + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, 1, "هـ" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, 1, "ዓ/ም" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, 1, "сл.Хр." }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, 1, "খৃষ্টাব্দ" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, 1, "খ্রিঃ" }; // খৃষ্টাব্দ + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, 1, "dC" }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, 1, "dC" }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, 1, "n.l." }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, 1, "eKr" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, 1, "μ.Χ." }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, 1, "μ.Χ." }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, 1, "A" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, 1, "A" }; // AD + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, 1, "d. C." }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, 1, "d.C." }; // d. C. + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, 1, "d.C." }; // d. C. + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, 1, "pKr" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, 1, "ه.ش" }; // ه‍.ش. + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, 1, "jKr" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, 1, "ઇસ" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, 1, "אחריי" }; // לספירה + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, 1, "ईस्वी" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, 1, "AD" }; // po. Kr. + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, 1, "isz." }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, 1, "M" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, 1, "dC" }; // d.C. + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, 1, "dC" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, 1, "ಕ್ರಿ.ಶ" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, 1, "po Kr." }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, 1, "m.ē." }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, 1, "എഡി" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, 1, "इ. स." }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, 1, "TM" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, 1, "TM" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, 1, "TM" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, 1, "n.C." }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, 1, "n.C." }; // n.Chr. + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, 1, "n.C." }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, 1, "n.e." }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, 1, "d.Hr." }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, 1, "н.э." }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, 1, "po Kr." }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, 1, "po Kr." }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, 1, "н.е." }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, 1, "n.e." }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, 1, "క్రీశ" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, 1, "พ.ศ." }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, 1, "MS" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, 1, "MS" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, 1, "н.е." }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, 1, "sau CN" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, 1, "西元" }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetEraName.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetEraName.cs index ebe820f7646e2..e1bd71dd45580 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetEraName.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoGetEraName.cs @@ -13,13 +13,393 @@ public static IEnumerable GetEraName_TestData() yield return new object[] { DateTimeFormatInfo.InvariantInfo, 1, "A.D." }; yield return new object[] { DateTimeFormatInfo.InvariantInfo, 0, "A.D." }; - var enUSFormat = new CultureInfo("en-US").DateTimeFormat; - yield return new object[] { enUSFormat, 1, DateTimeFormatInfoData.EnUSEraName() }; - yield return new object[] { enUSFormat, 0, DateTimeFormatInfoData.EnUSEraName() }; + if (!PlatformDetection.IsHybridGlobalizationOnBrowser) + { + var enUSFormat = new CultureInfo("en-US").DateTimeFormat; + yield return new object[] { enUSFormat, 1, DateTimeFormatInfoData.EnUSEraName() }; + yield return new object[] { enUSFormat, 0, DateTimeFormatInfoData.EnUSEraName() }; - var frRFormat = new CultureInfo("fr-FR").DateTimeFormat; - yield return new object[] { frRFormat, 1, "ap. J.-C." }; - yield return new object[] { frRFormat, 0, "ap. J.-C." }; + var frRFormat = new CultureInfo("fr-FR").DateTimeFormat; + yield return new object[] { frRFormat, 1, "ap. J.-C." }; + yield return new object[] { frRFormat, 0, "ap. J.-C." }; + } + else + { + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, 0, "بعد الهجرة" }; + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, 1, "بعد الهجرة" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, 0, "ዓ/ም" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, 1, "ዓ/ም" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, 0, "сл.Хр." }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, 1, "сл.Хр." }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, 0, "খৃষ্টাব্দ" }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, 1, "খৃষ্টাব্দ" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, 0, "খ্রিঃ" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, 1, "খ্রিঃ" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, 0, "dC" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, 1, "dC" }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, 0, "dC" }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, 1, "dC" }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, 0, "n. l." }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, 1, "n. l." }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, 0, "e.Kr." }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, 0, "n. Chr." }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, 1, "n. Chr." }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, 0, "μ.Χ." }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, 1, "μ.Χ." }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, 0, "μ.Χ." }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, 1, "μ.Χ." }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, 0, "d. C." }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, 1, "d. C." }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, 0, "d.C." }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, 0, "d.C." }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, 0, "pKr" }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, 1, "pKr" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, 0, "ه.ش" }; // ه‍.ش. + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, 1, "ه.ش" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, 0, "jKr." }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, 1, "jKr." }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, 0, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, 0, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, 0, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, 0, "ap. J.-C." }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, 1, "ap. J.-C." }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, 0, "ઈ.સ." }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, 1, "ઈ.સ." }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, 0, "לספירה" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, 1, "לספירה" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, 0, "ईस्वी" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, 1, "ईस्वी" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, 0, "po. Kr." }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, 1, "po. Kr." }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, 0, "po. Kr." }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, 1, "po. Kr." }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, 0, "i. sz." }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, 1, "i. sz." }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, 0, "M" }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, 1, "M" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, 0, "d.C." }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, 0, "d.C." }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, 0, "西暦" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, 1, "西暦" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, 0, "ಕ್ರಿ.ಶ" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, 1, "ಕ್ರಿ.ಶ" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, 0, "AD" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, 1, "AD" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, 0, "po Kr." }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, 1, "po Kr." }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, 0, "m.ē." }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, 1, "m.ē." }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, 0, "എഡി" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, 1, "എഡി" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, 0, "इ. स." }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, 1, "इ. स." }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, 0, "TM" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, 1, "TM" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, 0, "TM" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, 1, "TM" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, 0, "TM" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, 1, "TM" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, 0, "e.Kr." }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, 0, "e.Kr." }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, 0, "e.Kr." }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, 0, "n.Chr." }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, 1, "n.Chr." }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, 0, "n.Chr." }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, 1, "n.Chr." }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, 0, "n.Chr." }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, 1, "n.Chr." }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, 0, "n.e." }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, 1, "n.e." }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, 0, "d.C." }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, 0, "d.C." }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, 1, "d.C." }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, 0, "d.Hr." }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, 1, "d.Hr." }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, 0, "н. э." }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, 1, "н. э." }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, 0, "po Kr." }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, 1, "po Kr." }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, 0, "po Kr." }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, 1, "po Kr." }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, 0, "н. е." }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, 1, "н. е." }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, 0, "n. e." }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, 1, "n. e." }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, 0, "e.Kr." }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, 0, "e.Kr." }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, 1, "e.Kr." }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, 0, "BK" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, 0, "BK" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, 0, "BK" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, 0, "BK" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, 1, "BK" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, 0, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, 0, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, 0, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, 0, "கி.பி." }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, 1, "கி.பி." }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, 0, "క్రీశ" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, 1, "క్రీశ" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, 0, "พ.ศ." }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, 1, "พ.ศ." }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, 0, "MS" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, 1, "MS" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, 0, "MS" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, 1, "MS" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, 0, "н. е." }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, 1, "н. е." }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, 0, "CN" }; // sau CN + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, 1, "CN" }; // sau CN + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, 0, "公元" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, 0, "公元" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, 0, "公元" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, 0, "公元" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, 1, "公元" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, 0, "西元" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, 1, "西元" }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongDatePattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongDatePattern.cs index 9f1c75c627e70..dd8eebdefce34 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongDatePattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongDatePattern.cs @@ -8,7 +8,6 @@ namespace System.Globalization.Tests { public class DateTimeFormatInfoLongDatePattern { - [Fact] public void LongDatePattern_InvariantInfo_ReturnsExpected() { @@ -26,6 +25,204 @@ public static IEnumerable LongDatePattern_Set_TestData() yield return new object[] { "dddd, dd MMMM yyyy" }; } + public static IEnumerable LongDatePattern_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "dddd، d MMMM yyyy" }; // dddd، d MMMM yyyy g + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "yyyy MMMM d, dddd" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "dddd, d MMMM yyyy г." }; // "dddd, d MMMM yyyy 'г'." + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // "dddd, d MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // "dddd, d MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "dddd d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "dddd den d. MMMM yyyy" }; // dddd 'den' d. MMMM yyyy + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "dddd d MMMM yyyy" }; // "dddd, d MMMM yyyy" + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "dddd d MMMM yyyy" }; // "dddd, d MMMM yyyy" + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "dddd, d MMMM yyyy" }; // "dddd, dd MMMM yyyy" + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "dddd, d MMMM yyyy" }; // "dddd, dd MMMM yyyy" + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "dddd, MMMM d, yyyy" }; // "dddd, d MMMM yyyy" + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "dddd, d MMMM yyyy" }; // "dddd, dd MMMM yyyy" + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "dddd, d MMMM yyyy" }; // "dddd, dd MMMM yyyy" + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // dddd, d 'de' MMMM 'de' yyyy + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // dddd, d 'de' MMMM 'de' yyyy + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // dddd, d 'de' MMMM 'de' yyyy + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "dddd, d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "yyyy MMMM d, dddd" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "dddd d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "dddd, d בMMMM yyyy" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "dddd, d. MMMM yyyy." }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "dddd, d. MMMM yyyy." }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "yyyy. MMMM d., dddd" }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "dddd, d MMMM yyyy" }; // "dddd, dd MMMM yyyy" + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "yyyy年M月d日dddd" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "dddd, MMMM d, yyyy" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "yyyy년 M월 d일 dddd" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "yyyy m. MMMM d d., dddd" }; // "yyyy 'm'. MMMM d 'd'., dddd" + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "dddd, yyyy. gada d. MMMM" }; // "dddd, yyyy. 'gada' d. MMMM" + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "yyyy, MMMM d, dddd" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "dddd, d MMMM yyyy" }; // "dd MMMM yyyy" + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "dddd d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "dddd d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // dddd, d 'de' MMMM 'de' yyyy + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "dddd, d de MMMM de yyyy" }; // dddd, d 'de' MMMM 'de' yyyy + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "dddd, d MMMM yyyy г." }; // "dddd, d MMMM yyyy 'г'." + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "dddd d. MMMM yyyy" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "dddd, d. MMMM yyyy" }; // "dddd, dd. MMMM yyyy" + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "dddd, d. MMMM yyyy." }; // "dddd, dd. MMMM yyyy" + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "dddd, d. MMMM yyyy." }; // "dddd, dd. MMMM yyyy" + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "dddd d MMMM yyyy" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "dddd, d MMMM yyyy" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "d, MMMM yyyy, dddd" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "ddddที่ d MMMM g yyyy" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "d MMMM yyyy dddd" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "d MMMM yyyy dddd" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "dddd, d MMMM yyyy р." }; // "dddd, d MMMM yyyy 'р'." + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "dddd, d MMMM, yyyy" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "yyyy年M月d日dddd" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "yyyy年M月d日dddd" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "yyyy年M月d日dddd" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "yyyy年M月d日dddd" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "yyyy年M月d日 dddd" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(LongDatePattern_Get_TestData_HybridGlobalization))] + public void LongDatePattern_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string expected) + { + Assert.Equal(expected, format.LongDatePattern); + } + [Theory] [MemberData(nameof(LongDatePattern_Set_TestData))] public void LongDatePattern_Set_GetReturnsExpected(string value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongTimePattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongTimePattern.cs index e89d731c3b570..5992624b1e10f 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongTimePattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoLongTimePattern.cs @@ -14,6 +14,204 @@ public void LongTimePattern_GetInvariantInfo_ReturnsExpected() Assert.Equal("HH:mm:ss", DateTimeFormatInfo.InvariantInfo.LongTimePattern); } + public static IEnumerable LongTimePattern_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "H:mm:ss ч." }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "HH.mm.ss" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "HH.mm.ss" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "H.mm.ss" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "HH:mm:ss" }; // H:mm:ss + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "H.mm.ss" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "HH h mm min ss s" }; // HH 'h' mm 'min' ss 's' + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "hh:mm:ss tt" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "HH.mm.ss" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "hh:mm:ss tt" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "tt h:mm:ss" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "H:mm:ss" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "tt h:mm:ss" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "tt h:mm:ss" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "tt h:mm:ss" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "h:mm:ss tt" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "HH:mm:ss" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "HH:mm:ss" }; // tth:mm:ss + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "tth:mm:ss" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "tth:mm:ss" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "tth:mm:ss" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "tth:mm:ss" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(LongTimePattern_Get_TestData_HybridGlobalization))] + public void LongTimePattern_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string value) + { + Assert.Equal(value, format.LongTimePattern); + } + public static IEnumerable LongTimePattern_Set_TestData() { yield return new object[] { string.Empty }; diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthDayPattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthDayPattern.cs index 3ca5b313cbf5c..591b25f94c61c 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthDayPattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthDayPattern.cs @@ -9,7 +9,7 @@ namespace System.Globalization.Tests public class DateTimeFormatInfoMonthDayPattern { [Fact] - public void LongDayPattern_GetInvariantInfo_ReturnsExpected() + public void MonthDayPattern_GetInvariantInfo_ReturnsExpected() { Assert.Equal("MMMM dd", DateTimeFormatInfo.InvariantInfo.MonthDayPattern); } @@ -26,6 +26,204 @@ public static IEnumerable MonthDayPattern_Set_TestData() yield return new object[] { "m" }; } + public static IEnumerable MonthDayPattern_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "d de MMMM" }; // d MMMM + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "d de MMMM" }; // d MMMM + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "MMMM d" }; // "d MMMM" + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "d de MMMM" }; // d 'de' MMMM + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "d de MMMM" }; // d 'de' MMMM + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "d de MMMM" }; // d 'de' MMMM + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "d MMMM" }; // "MMMM d" + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "d בMMMM" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "MMMM d." }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "M月d日" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "MMMM d일" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "MMMM d d." }; // MMMM d 'd'. + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "MMMM d" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "d de MMMM" }; // d 'de' MMMM + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "d de MMMM" }; // d 'de' MMMM + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "d. MMMM" }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "d MMMM" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "M月d日" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "M月d日" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "M月d日" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "M月d日" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(MonthDayPattern_Get_TestData_HybridGlobalization))] + public void MonthDayPattern_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string expected) + { + Assert.Equal(expected, format.MonthDayPattern); + } + [Theory] [MemberData(nameof(MonthDayPattern_Set_TestData))] public void MonthDayPattern_Set_GetReturnsExpected(string value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthGenitiveNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthGenitiveNames.cs index 0e9534b685336..1587c514e827b 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthGenitiveNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthGenitiveNames.cs @@ -31,6 +31,197 @@ public static IEnumerable MonthGenitiveNames_Get_TestData() "" } }; + if (PlatformDetection.IsHybridGlobalizationOnBrowser) + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة", "" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "ጃንዩወሪ", "ፌብሩወሪ", "ማርች", "ኤፕሪል", "ሜይ", "ጁን", "ጁላይ", "ኦገስት", "ሴፕቴምበር", "ኦክቶበር", "ኖቬምበር", "ዲሴምበር", "" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "януари", "февруари", "март", "април", "май", "юни", "юли", "август", "септември", "октомври", "ноември", "декември", "" } }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, new string[] { "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" } }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, new string[] { "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" } }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, new string[] { "gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre", "" } }; // "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre", "" + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, new string[] { "gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre", "" } }; // "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre", "" + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "ledna", "února", "března", "dubna", "května", "června", "července", "srpna", "září", "října", "listopadu", "prosince", "" } }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, new string[] { "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, new string[] { "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, new string[] { "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, new string[] { "Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου", "" } }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, new string[] { "Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου", "" } }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", "" } }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, new string[] { "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", "" } }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, new string[] { "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", "" } }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "jaanuar", "veebruar", "märts", "aprill", "mai", "juuni", "juuli", "august", "september", "oktoober", "november", "detsember", "" } }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "tammikuuta", "helmikuuta", "maaliskuuta", "huhtikuuta", "toukokuuta", "kesäkuuta", "heinäkuuta", "elokuuta", "syyskuuta", "lokakuuta", "marraskuuta", "joulukuuta", "" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Enero", "Pebrero", "Marso", "Abril", "Mayo", "Hunyo", "Hulyo", "Agosto", "Setyembre", "Oktubre", "Nobyembre", "Disyembre", "" } }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "જાન્યુઆરી", "ફેબ્રુઆરી", "માર્ચ", "એપ્રિલ", "મે", "જૂન", "જુલાઈ", "ઑગસ્ટ", "સપ્ટેમ્બર", "ઑક્ટોબર", "નવેમ્બર", "ડિસેમ્બર", "" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר", "" } }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, new string[] { "जनवरी", "फ़रवरी", "मार्च", "अप्रैल", "मई", "जून", "जुलाई", "अगस्त", "सितंबर", "अक्तूबर", "नवंबर", "दिसंबर", "" } }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, new string[] { "siječnja", "veljače", "ožujka", "travnja", "svibnja", "lipnja", "srpnja", "kolovoza", "rujna", "listopada", "studenoga", "prosinca", "" } }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, new string[] { "siječnja", "veljače", "ožujka", "travnja", "svibnja", "lipnja", "srpnja", "kolovoza", "rujna", "listopada", "studenoga", "prosinca", "" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december", "" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember", "" } }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, new string[] { "gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre", "" } }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, new string[] { "gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre", "" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಜನವರಿ", "ಫೆಬ್ರವರಿ", "ಮಾರ್ಚ್", "ಏಪ್ರಿಲ್", "ಮೇ", "ಜೂನ್", "ಜುಲೈ", "ಆಗಸ್ಟ್", "ಸೆಪ್ಟೆಂಬರ್", "ಅಕ್ಟೋಬರ್", "ನವೆಂಬರ್", "ಡಿಸೆಂಬರ್", "" } }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월", "" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "sausio", "vasario", "kovo", "balandžio", "gegužės", "birželio", "liepos", "rugpjūčio", "rugsėjo", "spalio", "lapkričio", "gruodžio", "" } }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "janvāris", "februāris", "marts", "aprīlis", "maijs", "jūnijs", "jūlijs", "augusts", "septembris", "oktobris", "novembris", "decembris", "" } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ജനുവരി", "ഫെബ്രുവരി", "മാർച്ച്", "ഏപ്രിൽ", "മേയ്", "ജൂൺ", "ജൂലൈ", "ഓഗസ്റ്റ്", "സെപ്റ്റംബർ", "ഒക്‌ടോബർ", "നവംബർ", "ഡിസംബർ", "" } }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, new string[] { "जानेवारी", "फेब्रुवारी", "मार्च", "एप्रिल", "मे", "जून", "जुलै", "ऑगस्ट", "सप्टेंबर", "ऑक्टोबर", "नोव्हेंबर", "डिसेंबर", "" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember", "" } }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, new string[] { "Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember", "" } }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, new string[] { "Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember", "" } }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, new string[] { "januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", "" } }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, new string[] { "januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", "" } }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, new string[] { "januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", "" } }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, new string[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, new string[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, new string[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia", "" } }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, new string[] { "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", "" } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", "" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie", "" } }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, new string[] { "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря", "" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "januára", "februára", "marca", "apríla", "mája", "júna", "júla", "augusta", "septembra", "októbra", "novembra", "decembra", "" } }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, new string[] { "januar", "februar", "marec", "april", "maj", "junij", "julij", "avgust", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, new string[] { "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар", "" } }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, new string[] { "januar", "februar", "mart", "april", "maj", "jun", "jul", "avgust", "septembar", "oktobar", "novembar", "decembar", "" } }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, new string[] { "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, new string[] { "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "జనవరి", "ఫిబ్రవరి", "మార్చి", "ఏప్రిల్", "మే", "జూన్", "జులై", "ఆగస్టు", "సెప్టెంబర్", "అక్టోబర్", "నవంబర్", "డిసెంబర్", "" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม", "" } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık", "" } }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, new string[] { "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık", "" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня", "" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12", "" } }; // ICU: tháng + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, new string[] { "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", "" } }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, new string[] { "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", "" } }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; // "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", "" + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthNames.cs index 5379462156c4a..f7c18161dd6de 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoMonthNames.cs @@ -28,6 +28,205 @@ public static IEnumerable MonthNames_Set_TestData() yield return new object[] { new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "" } }; } + public static IEnumerable MonthNames_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة", "" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "ጃንዩወሪ", "ፌብሩወሪ", "ማርች", "ኤፕሪል", "ሜይ", "ጁን", "ጁላይ", "ኦገስት", "ሴፕቴምበር", "ኦክቶበር", "ኖቬምበር", "ዲሴምበር", "" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "януари", "февруари", "март", "април", "май", "юни", "юли", "август", "септември", "октомври", "ноември", "декември", "" } }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, new string[] { "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" } }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, new string[] { "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর", "" } }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, new string[] { "gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre", "" } }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, new string[] { "gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre", "" } }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "leden", "únor", "březen", "duben", "květen", "červen", "červenec", "srpen", "září", "říjen", "listopad", "prosinec", "" } }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, new string[] { "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, new string[] { "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, new string[] { "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, new string[] { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", "" } }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, new string[] { "Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου", "" } }; // BUG!!! JS returns Genitive for Greek even though we expect Nominative; "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος" + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, new string[] { "Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου", "" } }; // BUG!!! JS returns Genitive for Greek even though we expect Nominative; "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος" + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" } }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", "" } }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, new string[] { "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", "" } }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, new string[] { "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", "" } }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "jaanuar", "veebruar", "märts", "aprill", "mai", "juuni", "juuli", "august", "september", "oktoober", "november", "detsember", "" } }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu", "" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Enero", "Pebrero", "Marso", "Abril", "Mayo", "Hunyo", "Hulyo", "Agosto", "Setyembre", "Oktubre", "Nobyembre", "Disyembre", "" } }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, new string[] { "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", "" } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "જાન્યુઆરી", "ફેબ્રુઆરી", "માર્ચ", "એપ્રિલ", "મે", "જૂન", "જુલાઈ", "ઑગસ્ટ", "સપ્ટેમ્બર", "ઑક્ટોબર", "નવેમ્બર", "ડિસેમ્બર", "" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר", "" } }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, new string[] { "जनवरी", "फ़रवरी", "मार्च", "अप्रैल", "मई", "जून", "जुलाई", "अगस्त", "सितंबर", "अक्तूबर", "नवंबर", "दिसंबर", "" } }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, new string[] { "siječanj", "veljača", "ožujak", "travanj", "svibanj", "lipanj", "srpanj", "kolovoz", "rujan", "listopad", "studeni", "prosinac", "" } }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, new string[] { "siječanj", "veljača", "ožujak", "travanj", "svibanj", "lipanj", "srpanj", "kolovoz", "rujan", "listopad", "studeni", "prosinac", "" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december", "" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember", "" } }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, new string[] { "gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre", "" } }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, new string[] { "gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre", "" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಜನವರಿ", "ಫೆಬ್ರವರಿ", "ಮಾರ್ಚ್", "ಏಪ್ರಿಲ್", "ಮೇ", "ಜೂನ್", "ಜುಲೈ", "ಆಗಸ್ಟ್", "ಸೆಪ್ಟೆಂಬರ್", "ಅಕ್ಟೋಬರ್", "ನವೆಂಬರ್", "ಡಿಸೆಂಬರ್", "" } }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월", "" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "sausis", "vasaris", "kovas", "balandis", "gegužė", "birželis", "liepa", "rugpjūtis", "rugsėjis", "spalis", "lapkritis", "gruodis", "" } }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "janvāris", "februāris", "marts", "aprīlis", "maijs", "jūnijs", "jūlijs", "augusts", "septembris", "oktobris", "novembris", "decembris", "" } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ജനുവരി", "ഫെബ്രുവരി", "മാർച്ച്", "ഏപ്രിൽ", "മേയ്", "ജൂൺ", "ജൂലൈ", "ഓഗസ്റ്റ്", "സെപ്റ്റംബർ", "ഒക്‌ടോബർ", "നവംബർ", "ഡിസംബർ", "" } }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, new string[] { "जानेवारी", "फेब्रुवारी", "मार्च", "एप्रिल", "मे", "जून", "जुलै", "ऑगस्ट", "सप्टेंबर", "ऑक्टोबर", "नोव्हेंबर", "डिसेंबर", "" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember", "" } }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, new string[] { "Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember", "" } }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, new string[] { "Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember", "" } }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, new string[] { "januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", "" } }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, new string[] { "januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", "" } }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, new string[] { "januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", "" } }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, new string[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, new string[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, new string[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień", "" } }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, new string[] { "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", "" } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", "" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie", "" } }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, new string[] { "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь", "" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "január", "február", "marec", "apríl", "máj", "jún", "júl", "august", "september", "október", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, new string[] { "januar", "februar", "marec", "april", "maj", "junij", "julij", "avgust", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, new string[] { "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар", "" } }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, new string[] { "januar", "februar", "mart", "april", "maj", "jun", "jul", "avgust", "septembar", "oktobar", "novembar", "decembar", "" } }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, new string[] { "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, new string[] { "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december", "" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, new string[] { "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba", "" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, new string[] { "ஜனவரி", "பிப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்", "" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "జనవరి", "ఫిబ్రవరి", "మార్చి", "ఏప్రిల్", "మే", "జూన్", "జులై", "ఆగస్టు", "సెప్టెంబర్", "అక్టోబర్", "నవంబర్", "డిసెంబర్", "" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม", "" } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık", "" } }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, new string[] { "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık", "" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "січень", "лютий", "березень", "квітень", "травень", "червень", "липень", "серпень", "вересень", "жовтень", "листопад", "грудень", "" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12", "" } }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, new string[] { "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", "" } }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, new string[] { "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", "" } }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; // "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", "" + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(MonthNames_Get_TestData_HybridGlobalization))] + public void MonthNames_Get_ReturnsExpected(DateTimeFormatInfo format, string[] expected) + { + Assert.Equal(expected, format.MonthNames); + } + [Theory] [MemberData(nameof(MonthNames_Set_TestData))] public void MonthNames_Set_GetReturnsExpected(string[] value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs new file mode 100644 index 0000000000000..f6d38524f67bc --- /dev/null +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs @@ -0,0 +1,210 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; +using System.Collections.Generic; + +namespace System.Globalization.Tests +{ + public class DateTimeFormatInfoNativeCalendarName + { + public static IEnumerable NativeCalendarName_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, in this collection it always differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "islamic-umalqura" }; // التقويم الإسلامي (أم القرى) + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "gregory" }; // የግሪጎሪያን የቀን አቆጣጠር + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "gregory" }; // григориански календар + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "gregory" }; // গ্রিগোরিয়ান ক্যালেন্ডার + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "gregory" }; // গ্রিগোরিয়ান ক্যালেন্ডার + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "gregory" }; // calendari gregorià + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "gregory" }; // calendari gregorià + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "gregory" }; // Gregoriánský kalendář + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "gregory" }; // gregoriansk kalender + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "gregory" }; // Gregorianischer Kalender + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "gregory" }; // Γρηγοριανό ημερολόγιο + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "gregory" }; // Gregorian Calendar + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "gregory" }; // calendario gregoriano + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "gregory" }; // Gregoriuse kalender + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "persian" }; // تقویم هجری شمسی + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "gregory" }; // gregoriaaninen kalenteri + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "gregory" }; // Gregorian na Kalendaryo + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "gregory" }; // calendrier grégorien + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "gregory" }; // ગ્રેગોરિઅન કેલેન્ડર + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "gregory" }; // לוח השנה הגרגוריאני + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "gregory" }; // ग्रेगोरियन कैलेंडर" + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "gregory" }; // gregorijanski kalendar + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "gregory" }; // Gergely-naptár + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "gregory" }; // Kalender Gregorian" + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "gregory" }; // Calendario gregoriano + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "gregory" }; // 西暦(グレゴリオ暦) + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "gregory" }; // ಗ್ರೆಗೋರಿಯನ್ ಕ್ಯಾಲೆಂಡರ್ + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "gregory" }; // 양력 + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "gregory" }; // Grigaliaus kalendorius + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "gregory" }; // Gregora kalendārs + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "gregory" }; // ഇംഗ്ലീഷ് കലണ്ടർ + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "gregory" }; // ग्रेगोरियन दिनदर्शिका + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "gregory" }; // Kalendar Gregory + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "gregory" }; // gregoriansk kalender + yield return new object[] { new CultureInfo("no").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "gregory" }; // Gregoriaanse kalender + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "gregory" }; // kalendarz gregoriański + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "gregory" }; // Calendário Gregoriano + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "gregory" }; // calendar gregory + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "gregory" }; // григорианский календарь + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "gregory" }; // gregoriánsky kalendár + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "gregory" }; // gregorijanski koledar + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "gregory" }; // грегоријански календар + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "gregory" }; // gregorijanski kalendar + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "gregory" }; // gregoriansk kalender + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "gregory" }; // Kalenda ya Kigregori + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "gregory" }; // கிரிகோரியன் நாள்காட்டி + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "gregory" };// గ్రేగోరియన్ క్యాలెండర్ + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "buddhist" }; // ปฏิทินพุทธ + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "gregory" }; // Miladi Takvim + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "gregory" }; // григоріанський календар + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "gregory" }; // Lịch Gregory + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "gregory" }; // 公历 + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "gregory" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "gregory" }; // 公曆 + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "gregory" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(NativeCalendarName_Get_TestData_HybridGlobalization))] + public void NativeCalendarName_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string expected) + { + Assert.Equal(expected, format.NativeCalendarName); + } + } +} diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoPMDesignator.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoPMDesignator.cs index 1c6f60bc3bc8b..5eeea693a400a 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoPMDesignator.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoPMDesignator.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Xunit; +using System.Collections.Generic; namespace System.Globalization.Tests { @@ -13,6 +14,204 @@ public void PMDesignator_GetInvariantInfo_ReturnsExpected() Assert.Equal("PM", DateTimeFormatInfo.InvariantInfo.PMDesignator); } + public static IEnumerable PMDesignator_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "م" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "ከሰዓት" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "сл.об." }; + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "p.\u00A0m." }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "p.\u00A0m." }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "odp." }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "μ.μ." }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "μ.μ." }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "PM" }; // "pm" + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "p.\u00A0m." }; // p.m. + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "p.\u00A0m." }; // p.m. + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "p.\u00A0m." }; // p.m. + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "بعدازظهر" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "ip." }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "אחה״צ" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "pm" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "du." }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "午後" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "ಅಪರಾಹ್ನ" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "오후" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "popiet" }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "pēcpusdienā" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "PM" }; // म.उ. + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "PTG" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "PTG" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "PTG" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "da tarde" }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "p.m." }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "pop." }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "PM" }; // по подне + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "PM" }; // po podne + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "em" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "em" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "பிற்பகல்" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "பிற்பகல்" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "பிற்பகல்" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "பிற்பகல்" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "PM" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "หลังเที่ยง" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "ÖS" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "ÖS" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "пп" }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "CH" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "下午" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "下午" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "下午" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "下午" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "下午" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(PMDesignator_Get_TestData_HybridGlobalization))] + public void PMDesignator_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string value) + { + Assert.Equal(value, format.PMDesignator); + } + [Theory] [InlineData("")] [InlineData("PP")] diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortDatePattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortDatePattern.cs index f167dabb116ed..36b6f4f7436d6 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortDatePattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortDatePattern.cs @@ -8,6 +8,205 @@ namespace System.Globalization.Tests { public class DateTimeFormatInfoShortDatePattern { + public static IEnumerable ShortDatePattern_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "d\u200f/M\u200f/yyyy" }; // "d\u200f/M\u200f/yyyy g" + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "d.MM.yyyy г." }; // "d.MM.yyyy 'г'." + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "yyyy-MM-dd" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "dd.MM.yyyy" }; // should be "dd/MM/yyyy" + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "d/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "M/d/yyyy" }; // "dd/MM/yyyy" + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "yyyy-MM-dd" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "yyyy/MM/dd" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "yyyy/M/d" }; // "yyyy/M/d" + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "d.M.yyyy" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "M/d/yyyy" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "d/MM/yyyy" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "yyyy-MM-dd" }; + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "d.M.yyyy" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "d. M. yyyy." }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "dd. MM. yyyy." }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "yyyy. MM. dd." }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "yyyy/MM/dd" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "yyyy. M. d." }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "yyyy-MM-dd" }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "d/MM/yyyy" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "d/MM/yyyy" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "d/MM/yyyy" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("no").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "dd-MM-yyyy" }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "d/MM/yyyy" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "dd-MM-yyyy" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "d.MM.yyyy" }; // "dd.MM.yyyy" + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "d. M. yyyy" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "d. MM. yyyy" }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "d.M.yyyy." }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "d.M.yyyy." }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "yyyy-MM-dd" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "yyyy-MM-dd" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "dd-MM-yyyy" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "d.MM.yyyy" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "d.MM.yyyy" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "dd.MM.yyyy" }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "yyyy/M/d" }; + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "dd/MM/yyyy" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "d/M/yyyy" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "yyyy/M/d" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(ShortDatePattern_Get_TestData_HybridGlobalization))] + public void ShortDatePattern_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string expected) + { + Assert.Equal(expected, format.ShortDatePattern); + } + [Fact] public void ShortDatePattern_InvariantInfo() { diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortTimePattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortTimePattern.cs index d2c77a2a0ca90..6afd8293248e8 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortTimePattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortTimePattern.cs @@ -14,6 +14,204 @@ public void ShortTimePattern_GetInvariantInfo_ReturnsExpected() Assert.Equal("HH:mm", DateTimeFormatInfo.InvariantInfo.ShortTimePattern); } + public static IEnumerable ShortTimePattern_Get_TestData_HybridGlobalization() + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "H:mm" }; // HH:mm + yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, "HH.mm" }; + yield return new object[] { new CultureInfo("de-AT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("de-BE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("de-CH").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("de-DE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("de-IT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("de-LI").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("el-GR").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-AE").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-AG").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-BM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-BS").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-BW").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-BZ").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-CA").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-CC").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-CH").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-CK").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-CM").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-CX").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-CY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-DE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-DK").DateTimeFormat, "HH.mm" }; + yield return new object[] { new CultureInfo("en-DM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-ER").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-FI").DateTimeFormat, "H.mm" }; + yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-GI").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-GM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-GU").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-GY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-HK").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-KE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-KI").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-KN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-KY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-LC").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-LR").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-LS").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-MG").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-MH").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-MO").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-MP").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-MS").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-MT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-MU").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-MW").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-MY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-NA").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-NF").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-NG").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-NL").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-NR").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-NU").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-NZ").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-PG").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-PH").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-PK").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-PN").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-PR").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-PW").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-RW").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-SB").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-SC").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-SD").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-SE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-SG").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-SH").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-SI").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-SL").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-SS").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-SX").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-SZ").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-TC").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-TK").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-TO").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-TT").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-TV").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-TZ").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-UG").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-UM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-VC").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-VG").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-VI").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-VU").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-WS").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("en-US").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "HH:mm" }; // H:mm + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, "H.mm" }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("fr-BE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, "HH h mm min" }; // HH 'h' mm + yield return new object[] { new CultureInfo("fr-CH").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, "hh:mm tt" }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, "HH.mm" }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("it-IT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, "hh:mm tt" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "tt h:mm" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("mr-IN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("ms-MY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("ms-SG").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("no-NO").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("nl-AW").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("nl-BE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("pt-BR").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, "H:mm" }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sv-AX").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sv-SE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sw-KE").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sw-TZ").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("sw-UG").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, "tt h:mm" }; + yield return new object[] { new CultureInfo("ta-LK").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("ta-MY").DateTimeFormat, "tt h:mm" }; + yield return new object[] { new CultureInfo("ta-SG").DateTimeFormat, "tt h:mm" }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, "h:mm tt" }; + yield return new object[] { new CultureInfo("tr-TR").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "HH:mm" }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "HH:mm" }; // tth:mm + yield return new object[] { new CultureInfo("zh-Hans-HK").DateTimeFormat, "tth:mm" }; + yield return new object[] { new CultureInfo("zh-SG").DateTimeFormat, "tth:mm" }; + yield return new object[] { new CultureInfo("zh-HK").DateTimeFormat, "tth:mm" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "tth:mm" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(ShortTimePattern_Get_TestData_HybridGlobalization))] + public void ShortTimePattern_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string value) + { + Assert.Equal(value, format.ShortTimePattern); + } + public static IEnumerable ShortTimePattern_Set_TestData() { yield return new object[] { string.Empty }; diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortestDayNames.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortestDayNames.cs index 6e8d620a50102..0640ea3e2547a 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortestDayNames.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoShortestDayNames.cs @@ -28,6 +28,67 @@ public static IEnumerable ShortestDayNames_Set_TestData() yield return new object[] { new string[] { "", "", "", "", "", "", "" } }; } + public static IEnumerable ShortestDayNames_Get_TestData_HybridGlobalization() + { + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "ح", "ن", "ث", "ر", "خ", "ج", "س" } }; + yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ" } }; + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, new string[] { "н", "п", "в", "с", "ч", "п", "с" } }; + yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, new string[] { "র", "সো", "ম", "বু", "বৃ", "শু", "শ" } }; + yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, new string[] { "dg", "dl", "dt", "dc", "dj", "dv", "ds" } }; + yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, new string[] { "N", "P", "Ú", "S", "Č", "P", "S" } }; + yield return new object[] { new CultureInfo("da-DK").DateTimeFormat, new string[] { "S", "M", "T", "O", "T", "F", "L" } }; + yield return new object[] { new CultureInfo("de-LU").DateTimeFormat, new string[] { "S", "M", "D", "M", "D", "F", "S" } }; + yield return new object[] { new CultureInfo("el-CY").DateTimeFormat, new string[] { "Κ", "Δ", "Τ", "Τ", "Π", "Π", "Σ" } }; + yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, new string[] { "Su.", "M.", "Tu.", "W.", "Th.", "F.", "Sa." } }; + yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, new string[] { "S", "M", "T", "W", "T", "F", "S" } }; + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, new string[] { "D", "L", "M", "M", "J", "V", "S" } }; + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, new string[] { "D", "L", "M", "X", "J", "V", "S" } }; + yield return new object[] { new CultureInfo("et-EE").DateTimeFormat, new string[] { "P", "E", "T", "K", "N", "R", "L" } }; + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, new string[] { "ی", "د", "س", "چ", "پ", "ج", "ش" } }; + yield return new object[] { new CultureInfo("fi-FI").DateTimeFormat, new string[] { "S", "M", "T", "K", "T", "P", "L" } }; + yield return new object[] { new CultureInfo("fil-PH").DateTimeFormat, new string[] { "Lin", "Lun", "Mar", "Miy", "Huw", "Biy", "Sab" } }; + yield return new object[] { new CultureInfo("fr-CA").DateTimeFormat, new string[] { "D", "L", "M", "M", "J", "V", "S" } }; + yield return new object[] { new CultureInfo("gu-IN").DateTimeFormat, new string[] { "ર", "સો", "મં", "બુ", "ગુ", "શુ", "શ" } }; + yield return new object[] { new CultureInfo("he-IL").DateTimeFormat, new string[] { "א׳", "ב׳", "ג׳", "ד׳", "ה׳", "ו׳", "ש׳" } }; + yield return new object[] { new CultureInfo("hi-IN").DateTimeFormat, new string[] { "र", "सो", "मं", "बु", "गु", "शु", "श" } }; + yield return new object[] { new CultureInfo("hr-BA").DateTimeFormat, new string[] { "N", "P", "U", "S", "Č", "P", "S" } }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, new string[] { "n", "p", "u", "s", "č", "p", "s" } }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, new string[] { "V", "H", "K", "Sz", "Cs", "P", "Sz" } }; + yield return new object[] { new CultureInfo("id-ID").DateTimeFormat, new string[] { "M", "S", "S", "R", "K", "J", "S" } }; + yield return new object[] { new CultureInfo("it-CH").DateTimeFormat, new string[] { "D", "L", "M", "M", "G", "V", "S" } }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, new string[] { "日", "月", "火", "水", "木", "金", "土" } }; + yield return new object[] { new CultureInfo("kn-IN").DateTimeFormat, new string[] { "ಭಾ", "ಸೋ", "ಮಂ", "ಬು", "ಗು", "ಶು", "ಶ" } }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, new string[] { "일", "월", "화", "수", "목", "금", "토" } }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, new string[] { "S", "P", "A", "T", "K", "P", "Š" } }; + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, new string[] { "S", "P", "O", "T", "C", "P", "S" } }; + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, new string[] { "ഞാ", "തി", "ചൊ", "ബു", "വ്യാ", "വെ", "ശ" } }; + yield return new object[] { new CultureInfo("ms-BN").DateTimeFormat, new string[] { "A", "I", "S", "R", "K", "J", "S" } }; + yield return new object[] { new CultureInfo("nb-NO").DateTimeFormat, new string[] { "S", "M", "T", "O", "T", "F", "L" } }; + yield return new object[] { new CultureInfo("nl-NL").DateTimeFormat, new string[] { "Z", "M", "D", "W", "D", "V", "Z" } }; + yield return new object[] { new CultureInfo("pl-PL").DateTimeFormat, new string[] { "N", "P", "W", "Ś", "C", "P", "S" } }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, new string[] { "D", "S", "T", "Q", "Q", "S", "S" } }; + yield return new object[] { new CultureInfo("ro-RO").DateTimeFormat, new string[] { "D", "L", "M", "M", "J", "V", "S" } }; + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, new string[] { "В", "П", "В", "С", "Ч", "П", "С" } }; + yield return new object[] { new CultureInfo("sk-SK").DateTimeFormat, new string[] { "n", "p", "u", "s", "š", "p", "s" } }; + yield return new object[] { new CultureInfo("sl-SI").DateTimeFormat, new string[] { "n", "p", "t", "s", "č", "p", "s" } }; + yield return new object[] { new CultureInfo("sr-Cyrl-RS").DateTimeFormat, new string[] { "н", "п", "у", "с", "ч", "п", "с" } }; + yield return new object[] { new CultureInfo("sw-CD").DateTimeFormat, new string[] { "S", "M", "T", "W", "T", "F", "S" } }; + yield return new object[] { new CultureInfo("ta-IN").DateTimeFormat, new string[] { "ஞா", "தி", "செ", "பு", "வி", "வெ", "ச" } }; + yield return new object[] { new CultureInfo("te-IN").DateTimeFormat, new string[] { "ఆ", "సో", "మ", "బు", "గు", "శు", "శ" } }; + yield return new object[] { new CultureInfo("th-TH").DateTimeFormat, new string[] { "อา", "จ", "อ", "พ", "พฤ", "ศ", "ส" } }; + yield return new object[] { new CultureInfo("tr-CY").DateTimeFormat, new string[] { "P", "P", "S", "Ç", "P", "C", "C" } }; + yield return new object[] { new CultureInfo("uk-UA").DateTimeFormat, new string[] { "Н", "П", "В", "С", "Ч", "П", "С" } }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, new string[] { "CN", "T2", "T3", "T4", "T5", "T6", "T7" } }; + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, new string[] { "日", "一", "二", "三", "四", "五", "六" } }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))] + [MemberData(nameof(ShortestDayNames_Get_TestData_HybridGlobalization))] + public void ShortestDayNames_Get_ReturnsExpected_HybridGlobalization(DateTimeFormatInfo format, string[] expected) + { + Assert.Equal(expected, format.ShortestDayNames); + } + [Theory] [MemberData(nameof(ShortestDayNames_Set_TestData))] public void ShortestDayNames_Set_GetReturnsExpected(string[] value) diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.cs index d4294604c2438..eacdfb0455a67 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.cs @@ -138,7 +138,7 @@ public void GetShortestDayName_Invoke_ReturnsExpected(string cultureName) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))] public void Months_GetHebrew_ReturnsExpected() { CultureInfo ci = new CultureInfo("he-IL"); diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoYearMonthPattern.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoYearMonthPattern.cs index 53c0028bf3c7b..a80c65a7bbf64 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoYearMonthPattern.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoYearMonthPattern.cs @@ -12,6 +12,30 @@ public static IEnumerable YearMonthPattern_Get_TestData() { yield return new object[] { DateTimeFormatInfo.InvariantInfo, "yyyy MMMM" }; yield return new object[] { new CultureInfo("fr-FR").DateTimeFormat, "MMMM yyyy" }; + if (PlatformDetection.IsHybridGlobalizationOnBrowser) + { + // see the comments on the right to check the non-Hybrid result, if it differs + yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "MMMM yyyy" }; // "MMMM yyyy g" + yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, "MMMM yyyy \u0433." }; // ICU: "MMMM yyyy '\u0433'." + yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "MMMM de yyyy" }; // ICU: "MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("es-419").DateTimeFormat, "MMMM de yyyy" }; // ICU: "MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "MMMM de yyyy" }; // ICU: "MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, "MMMM de yyyy" }; // ICU: "MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("fa-IR").DateTimeFormat, "yyyy MMMM" }; + yield return new object[] { new CultureInfo("hr-HR").DateTimeFormat, "MMMM yyyy." }; + yield return new object[] { new CultureInfo("hu-HU").DateTimeFormat, "yyyy. MMMM" }; + yield return new object[] { new CultureInfo("ja-JP").DateTimeFormat, "yyyy\u5e74M\u6708" }; + yield return new object[] { new CultureInfo("ko-KR").DateTimeFormat, "yyyy\ub144 MMMM" }; + yield return new object[] { new CultureInfo("lt-LT").DateTimeFormat, "yyyy m. MMMM" }; // ICU: "yyyy 'm'. MMMM" + yield return new object[] { new CultureInfo("lv-LV").DateTimeFormat, "yyyy. g. MMMM" }; // ICU: "yyyy. 'g'. MMMM" + yield return new object[] { new CultureInfo("ml-IN").DateTimeFormat, "yyyy MMMM" }; + yield return new object[] { new CultureInfo("pt-PT").DateTimeFormat, "MMMM de yyyy" }; // ICU: "MMMM 'de' yyyy" + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, "MMMM yyyy \u0433." }; // ICU: "MMMM yyyy '\u0433'." + yield return new object[] { new CultureInfo("sr-Latn-RS").DateTimeFormat, "MMMM yyyy." }; + yield return new object[] { new CultureInfo("vi-VN").DateTimeFormat, "MMMM n\u0103m yyyy" }; // ICU: "MMMM 'n\u0103m' yyyy" + yield return new object[] { new CultureInfo("zh-CN").DateTimeFormat, "yyyy\u5e74M\u6708" }; + yield return new object[] { new CultureInfo("zh-TW").DateTimeFormat, "yyyy\u5e74M\u6708" }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj b/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj index 0d842f484d9ca..a39604c1cfacc 100644 --- a/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj +++ b/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj @@ -3,6 +3,7 @@ $(NetCoreAppCurrent)-browser true true + true true @@ -14,5 +15,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 82eb84609a6f0..09f13e17a0729 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -319,6 +319,7 @@ + @@ -335,6 +336,7 @@ + @@ -1280,6 +1282,12 @@ Common\Interop\Interop.CompareInfo.cs + + + Common\Interop\Interop.Calendar.cs + + + Common\Interop\Browser\Interop.Locale.cs Common\Interop\Interop.TextInfo.cs diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Browser.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Browser.cs new file mode 100644 index 0000000000000..87199ed3f1eed --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Browser.cs @@ -0,0 +1,56 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace System.Globalization +{ + internal sealed partial class CalendarData + { + private const int CALENDAR_INFO_BUFFER_LEN = 1000; + private unsafe bool JSLoadCalendarDataFromBrowser(string localeName, CalendarId calendarId) + { + char* buffer = stackalloc char[CALENDAR_INFO_BUFFER_LEN]; + int exception; + object exResult; + int resultLength = Interop.JsGlobalization.GetCalendarInfo(localeName, calendarId, buffer, CALENDAR_INFO_BUFFER_LEN, out exception, out exResult); + if (exception != 0) + throw new Exception((string)exResult); + string result = new string(buffer, 0, resultLength); + string[] subresults = result.Split("##"); + if (subresults.Length < 14) + throw new Exception("CalendarInfo recieved from the Browser is in icorrect format."); + // JS always has one result per locale, so even arrays are initialized with one element + this.sNativeName = string.IsNullOrEmpty(subresults[0]) ? ((CalendarId)calendarId).ToString() : subresults[0]; // this is EnglishName, not NativeName but it's the best we can do + this.saYearMonths = new string[] { subresults[1] }; + this.sMonthDay = subresults[2]; + this.saLongDates = new string[] { subresults[3] }; + this.saShortDates = new string[] { subresults[4] }; + this.saEraNames = new string[] { subresults[5] }; + this.saAbbrevEraNames = new string[] { subresults[6] }; + this.saDayNames = subresults[7].Split("||"); + this.saAbbrevDayNames = subresults[8].Split("||"); + this.saSuperShortDayNames = subresults[9].Split("||"); + this.saMonthNames = ResizeMonthsArray(subresults[10].Split("||")); + this.saAbbrevMonthNames = ResizeMonthsArray(subresults[11].Split("||")); + this.saMonthGenitiveNames = ResizeMonthsArray(subresults[12].Split("||")); + this.saAbbrevMonthGenitiveNames = ResizeMonthsArray(subresults[13].Split("||")); + return true; + + static string[] ResizeMonthsArray(string[] months) + { + if (months.Length == 13) + return months; + // most calendars have 12 months and then we expect the 13th month to be empty + string[] resized = new string[13]; + resized[12] = ""; + months.CopyTo(resized, 0); + return resized; + } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs index 7d23ca01aec62..5bc85b88384ec 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs @@ -33,6 +33,7 @@ internal sealed partial class CalendarData { private bool IcuLoadCalendarDataFromSystem(string localeName, CalendarId calendarId) { + // ToDo: think if not to convert this function with multiple calls to JS into one call with multiple data requested at once Debug.Assert(!GlobalizationMode.UseNls); bool result = true; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs index ff4b34b2a35d2..cb15665c979ac 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs @@ -7,8 +7,16 @@ namespace System.Globalization { internal sealed partial class CalendarData { - private bool LoadCalendarDataFromSystemCore(string localeName, CalendarId calendarId) => - IcuLoadCalendarDataFromSystem(localeName, calendarId); + private bool LoadCalendarDataFromSystemCore(string localeName, CalendarId calendarId) + { +#if TARGET_BROWSER + return GlobalizationMode.Hybrid ? + JSLoadCalendarDataFromBrowser(localeName, calendarId) : + IcuLoadCalendarDataFromSystem(localeName, calendarId); +#else + return IcuLoadCalendarDataFromSystem(localeName, calendarId); +#endif + } #pragma warning disable IDE0060 internal static int GetCalendarsCore(string localeName, bool useUserOverride, CalendarId[] calendars) => diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs index d96ede7b7244f..b931ae5c89804 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs @@ -181,7 +181,7 @@ private void InitializeEraNames(string localeName, CalendarId calendarId) // For Localized Gregorian we really expect the data from the OS. case CalendarId.GREGORIAN: // Fallback for CoreCLR < Win7 or culture.dll missing - if (this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0])) + if (AreEraNamesEmpty()) { this.saEraNames = new string[] { "A.D." }; } @@ -243,16 +243,26 @@ private void InitializeEraNames(string localeName, CalendarId calendarId) break; case CalendarId.PERSIAN: - if (this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0])) + if (AreEraNamesEmpty()) { this.saEraNames = new string[] { "\x0647\x002e\x0634" }; } break; default: +#if TARGET_BROWSER + if (GlobalizationMode.Hybrid && !AreEraNamesEmpty()) + { + // we don't want to have this overwritten because JS already loaded it + break; + } +#endif // Most calendars are just "A.D." this.saEraNames = Invariant.saEraNames; break; + + bool AreEraNamesEmpty() => + this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0]); } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Browser.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Browser.cs new file mode 100644 index 0000000000000..ec2342e61e9be --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Browser.cs @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; + +namespace System.Globalization +{ + internal sealed partial class CultureData + { + private const int CULTURE_INFO_BUFFER_LEN = 50; + + private static unsafe CultureData JSLoadCultureInfoFromBrowser(string localeName, CultureData culture) + { + char* buffer = stackalloc char[CULTURE_INFO_BUFFER_LEN]; + int exception; + object exResult; + int resultLength = Interop.JsGlobalization.GetCultureInfo(localeName, buffer, CULTURE_INFO_BUFFER_LEN, out exception, out exResult); + if (exception != 0) + throw new Exception((string)exResult); + string result = new string(buffer, 0, resultLength); + string[] subresults = result.Split("##"); + if (subresults.Length < 4) + throw new Exception("CultureInfo recieved from the Browser is in incorrect format."); + culture._sAM1159 = subresults[0]; + culture._sPM2359 = subresults[1]; + culture._saLongTimes = new string[] { subresults[2] }; + culture._saShortTimes = new string[] { subresults[3] }; + return culture; + } + + private static unsafe int GetFirstDayOfWeek(string localeName) + { + int result = Interop.JsGlobalization.GetFirstDayOfWeek(localeName, out int exception, out object ex_result); + if (exception != 0) + { + // Failed, just use 0 + Debug.Fail($"[CultureData.GetFirstDayOfWeek()] failed with {ex_result}"); + return 0; + } + return result; + } + + private static unsafe int GetFirstWeekOfYear(string localeName) + { + int result = Interop.JsGlobalization.GetFirstWeekOfYear(localeName, out int exception, out object ex_result); + if (exception != 0) + { + // Failed, just use 0 + Debug.Fail($"[CultureData.GetFirstWeekOfYear()] failed with {ex_result}"); + return 0; + } + return result; + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs index 51cda682a3813..5628bf35fc506 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs @@ -811,11 +811,18 @@ private static string NormalizeCultureName(string name, out bool isNeutralName) culture._sRealName = cultureName; culture._bUseOverridesUserSetting = useUserOverride; - // Ask native code if that one's real + // Ask native code if that one's real, populate _sWindowsName if (!culture.InitCultureDataCore() && !culture.InitCompatibilityCultureData()) { return null; } +#if TARGET_BROWSER + // populate fields for which ICU does not provide data in Hybrid mode + if (GlobalizationMode.Hybrid && !string.IsNullOrEmpty(culture._sName)) + { + culture = JSLoadCultureInfoFromBrowser(culture._sName, culture); + } +#endif // We need _sWindowsName to be initialized to know if we're using overrides. culture.InitUserOverride(useUserOverride); @@ -1553,6 +1560,16 @@ internal int FirstDayOfWeek { #if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS _iFirstDayOfWeek = GlobalizationMode.Hybrid ? GetLocaleInfoNative(LocaleNumberData.FirstDayOfWeek) : IcuGetLocaleInfo(LocaleNumberData.FirstDayOfWeek); +#elif TARGET_BROWSER + if (GlobalizationMode.Hybrid) + { + Debug.Assert(_sName != null, "[FirstDayOfWeek] Expected _sName to be populated already"); + _iFirstDayOfWeek = GetFirstDayOfWeek(_sName); + } + else + { + _iFirstDayOfWeek = IcuGetLocaleInfo(LocaleNumberData.FirstDayOfWeek); + } #else _iFirstDayOfWeek = ShouldUseUserOverrideNlsData ? NlsGetFirstDayOfWeek() : IcuGetLocaleInfo(LocaleNumberData.FirstDayOfWeek); #endif @@ -1571,7 +1588,19 @@ internal int CalendarWeekRule { if (_iFirstWeekOfYear == undef) { +#if TARGET_BROWSER + if (GlobalizationMode.Hybrid) + { + Debug.Assert(_sName != null, "[CalendarWeekRule] Expected _sName to be populated already"); + _iFirstWeekOfYear = GetFirstWeekOfYear(_sName); + } + else + { + _iFirstWeekOfYear = GetLocaleInfoCoreUserOverride(LocaleNumberData.FirstWeekOfYear); + } +#else _iFirstWeekOfYear = GetLocaleInfoCoreUserOverride(LocaleNumberData.FirstWeekOfYear); +#endif } return _iFirstWeekOfYear; } diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs index 8b518113018c4..a8f68fb94ebf9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs @@ -1906,14 +1906,30 @@ private static bool GetDayOfNNY(ref DateTimeResult result, scoped ref DateTimeRa result.flags |= ParseFlags.HaveDate; return true; // MD + Year } +#if TARGET_BROWSER + // if we are parsing the datetime string with custom format then the CultureInfo format `order` + // does not matter and DM + Year is also possible for NNY + if (GlobalizationMode.Hybrid && SetDateYDM(ref result, raw.year, n1, n2)) + { + result.flags |= ParseFlags.HaveDate; + return true; // DM + Year + } +#endif } else { - if (SetDateYMD(ref result, raw.year, n2, n1)) + if (SetDateYDM(ref result, raw.year, n1, n2)) { result.flags |= ParseFlags.HaveDate; return true; // DM + Year } +#if TARGET_BROWSER + if (GlobalizationMode.Hybrid && SetDateYMD(ref result, raw.year, n1, n2)) + { + result.flags |= ParseFlags.HaveDate; + return true; // MD + Year + } +#endif } result.SetBadDateTimeFailure(); return false; diff --git a/src/mono/wasm/runtime/corebindings.c b/src/mono/wasm/runtime/corebindings.c index 0dd7f9f3a15da..e12a0adc379e9 100644 --- a/src/mono/wasm/runtime/corebindings.c +++ b/src/mono/wasm/runtime/corebindings.c @@ -55,6 +55,10 @@ extern int mono_wasm_compare_string(MonoString **culture, const uint16_t* str1, extern mono_bool mono_wasm_starts_with(MonoString **culture, const uint16_t* str1, int32_t str1Length, const uint16_t* str2, int32_t str2Length, int32_t options, int *is_exception, MonoObject** ex_result); extern mono_bool mono_wasm_ends_with(MonoString **culture, const uint16_t* str1, int32_t str1Length, const uint16_t* str2, int32_t str2Length, int32_t options, int *is_exception, MonoObject** ex_result); extern int mono_wasm_index_of(MonoString **culture, const uint16_t* str1, int32_t str1Length, const uint16_t* str2, int32_t str2Length, int32_t options, mono_bool fromBeginning, int *is_exception, MonoObject** ex_result); +extern int mono_wasm_get_calendar_info(MonoString **culture, int32_t calendarId, const uint16_t* result, int32_t resultLength, int *is_exception, MonoObject** ex_result); +extern int mono_wasm_get_culture_info(MonoString **culture, const uint16_t* result, int32_t resultLength, int *is_exception, MonoObject** ex_result); +extern int mono_wasm_get_first_day_of_week(MonoString **culture, int *is_exception, MonoObject** ex_result); +extern int mono_wasm_get_first_week_of_year(MonoString **culture, int *is_exception, MonoObject** ex_result); void bindings_initialize_internals (void) { @@ -93,4 +97,8 @@ void bindings_initialize_internals (void) mono_add_internal_call ("Interop/JsGlobalization::StartsWith", mono_wasm_starts_with); mono_add_internal_call ("Interop/JsGlobalization::EndsWith", mono_wasm_ends_with); mono_add_internal_call ("Interop/JsGlobalization::IndexOf", mono_wasm_index_of); -} + mono_add_internal_call ("Interop/JsGlobalization::GetCalendarInfo", mono_wasm_get_calendar_info); + mono_add_internal_call ("Interop/JsGlobalization::GetCultureInfo", mono_wasm_get_culture_info); + mono_add_internal_call ("Interop/JsGlobalization::GetFirstDayOfWeek", mono_wasm_get_first_day_of_week); + mono_add_internal_call ("Interop/JsGlobalization::GetFirstWeekOfYear", mono_wasm_get_first_week_of_year); +} \ No newline at end of file diff --git a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js index dad64ed0713b2..f0758376d40be 100644 --- a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js +++ b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js @@ -122,6 +122,10 @@ let linked_functions = [ "mono_wasm_starts_with", "mono_wasm_ends_with", "mono_wasm_index_of", + "mono_wasm_get_calendar_info", + "mono_wasm_get_culture_info", + "mono_wasm_get_first_day_of_week", + "mono_wasm_get_first_week_of_year", "icudt68_dat", ]; @@ -180,4 +184,4 @@ for (let linked_function of linked_functions) { } autoAddDeps(DotnetSupportLib, "$DOTNET"); -mergeInto(LibraryManager.library, DotnetSupportLib); +mergeInto(LibraryManager.library, DotnetSupportLib); \ No newline at end of file diff --git a/src/mono/wasm/runtime/exports-linker.ts b/src/mono/wasm/runtime/exports-linker.ts index 440fdda419fb1..3c9a6f9482334 100644 --- a/src/mono/wasm/runtime/exports-linker.ts +++ b/src/mono/wasm/runtime/exports-linker.ts @@ -23,6 +23,7 @@ import { mono_wasm_trace_logger } from "./logging"; import { mono_wasm_profiler_leave, mono_wasm_profiler_enter } from "./profiler"; import { mono_wasm_change_case, mono_wasm_change_case_invariant } from "./hybrid-globalization/change-case"; import { mono_wasm_compare_string, mono_wasm_ends_with, mono_wasm_starts_with, mono_wasm_index_of } from "./hybrid-globalization/collations"; +import { mono_wasm_get_calendar_info } from "./hybrid-globalization/calendar"; import { mono_wasm_install_js_worker_interop, mono_wasm_uninstall_js_worker_interop } from "./pthreads/shared"; import { @@ -32,6 +33,8 @@ import { import { mono_wasm_create_cs_owned_object_ref } from "./net6-legacy/cs-to-js"; import { mono_wasm_typed_array_to_array_ref } from "./net6-legacy/js-to-cs"; import { mono_wasm_typed_array_from_ref } from "./net6-legacy/buffers"; +import { mono_wasm_get_culture_info } from "./hybrid-globalization/culture-info"; +import { mono_wasm_get_first_day_of_week, mono_wasm_get_first_week_of_year } from "./hybrid-globalization/locales"; // the methods would be visible to EMCC linker // --- keep in sync with dotnet.cjs.lib.js --- @@ -112,10 +115,14 @@ export function export_linker(): any { mono_wasm_starts_with, mono_wasm_ends_with, mono_wasm_index_of, + mono_wasm_get_calendar_info, + mono_wasm_get_culture_info, + mono_wasm_get_first_day_of_week, + mono_wasm_get_first_week_of_year, // threading exports, if threading is enabled ...mono_wasm_threads_exports, // legacy interop exports, if enabled ...mono_wasm_legacy_interop_exports }; -} +} \ No newline at end of file diff --git a/src/mono/wasm/runtime/hybrid-globalization/calendar.ts b/src/mono/wasm/runtime/hybrid-globalization/calendar.ts new file mode 100644 index 0000000000000..8f399f05887f5 --- /dev/null +++ b/src/mono/wasm/runtime/hybrid-globalization/calendar.ts @@ -0,0 +1,380 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/* eslint-disable no-inner-declarations */ +import { mono_wasm_new_external_root } from "../roots"; +import { monoStringToString, stringToUTF16 } from "../strings"; +import { MonoObject, MonoObjectRef, MonoString, MonoStringRef } from "../types/internal"; +import { Int32Ptr } from "../types/emscripten"; +import { wrap_error_root, wrap_no_error_root } from "../invoke-js"; +import { INNER_SEPARATOR, OUTER_SEPARATOR } from "./helpers"; + +const MONTH_CODE = "MMMM"; +const YEAR_CODE = "yyyy"; +const DAY_CODE = "d"; + +// this function joins all calendar info with OUTER_SEPARATOR into one string and returns it back to managed code +export function mono_wasm_get_calendar_info(culture: MonoStringRef, calendarId: number, dst: number, dstLength: number, isException: Int32Ptr, exAddress: MonoObjectRef): number +{ + const cultureRoot = mono_wasm_new_external_root(culture), + exceptionRoot = mono_wasm_new_external_root(exAddress); + try { + const cultureName = monoStringToString(cultureRoot); + const locale = cultureName ? cultureName : undefined; + const calendarInfo = { + EnglishName: "", + YearMonth: "", + MonthDay: "", + LongDates: "", + ShortDates: "", + EraNames: "", + AbbreviatedEraNames: "", + DayNames: "", + AbbreviatedDayNames: "", + ShortestDayNames: "", + MonthNames: "", + AbbreviatedMonthNames: "", + MonthGenitiveNames: "", + AbbrevMonthGenitiveNames: "", + }; + const date = new Date(999, 10, 22); // Fri Nov 22 0999 00:00:00 GMT+0124 (Central European Standard Time) + calendarInfo.EnglishName = getCalendarName(locale); + const dayNames = getDayNames(locale); + calendarInfo.DayNames = dayNames.long.join(INNER_SEPARATOR); + calendarInfo.AbbreviatedDayNames = dayNames.abbreviated.join(INNER_SEPARATOR); + calendarInfo.ShortestDayNames = dayNames.shortest.join(INNER_SEPARATOR); + const monthNames = getMonthNames(locale); + calendarInfo.MonthNames = monthNames.long.join(INNER_SEPARATOR); + calendarInfo.AbbreviatedMonthNames = monthNames.abbreviated.join(INNER_SEPARATOR); + calendarInfo.MonthGenitiveNames = monthNames.longGenitive.join(INNER_SEPARATOR); + calendarInfo.AbbrevMonthGenitiveNames = monthNames.abbreviatedGenitive.join(INNER_SEPARATOR); + calendarInfo.YearMonth = getMonthYearPattern(locale, date); + calendarInfo.MonthDay = getMonthDayPattern(locale, date); + calendarInfo.ShortDates = getShortDatePattern(locale); + calendarInfo.LongDates = getLongDatePattern(locale, date); + const eraNames = getEraNames(date, locale, calendarId); + calendarInfo.EraNames = eraNames.eraNames; + calendarInfo.AbbreviatedEraNames = eraNames.abbreviatedEraNames; + + const result = Object.values(calendarInfo).join(OUTER_SEPARATOR); + if (result.length > dstLength) + { + throw new Error(`Calendar info exceeds length of ${dstLength}.`); + } + stringToUTF16(dst, dst + 2 * result.length, result); + wrap_no_error_root(isException, exceptionRoot); + return result.length; + } + catch (ex: any) { + wrap_error_root(isException, ex, exceptionRoot); + return -1; + } + finally { + cultureRoot.release(); + exceptionRoot.release(); + } +} + +function getCalendarName(locale: any){ + const calendars = getCalendarInfo(locale); + if (!calendars || calendars.length == 0) + return ""; + return calendars[0]; +} + +function getCalendarInfo(locale: string) +{ + try { + // most tools have it implemented as a property + return (new Intl.Locale(locale) as any).calendars; + } + catch { + try { + // but a few use methods, which is the preferred way + return (new Intl.Locale(locale) as any).getCalendars(); + } + catch + { + return undefined; + } + } +} + +function getMonthYearPattern(locale: string | undefined, date: Date): string +{ + let pattern = date.toLocaleDateString(locale, { year: "numeric", month: "long" }).toLowerCase(); + // pattern has month name as string or as number + const monthName = date.toLocaleString(locale, { month: "long" }).toLowerCase().trim(); + if (monthName.charAt(monthName.length - 1) == "\u6708") + { + // Chineese-like patterns: + return "yyyy\u5e74M\u6708"; + } + pattern = pattern.replace(monthName, MONTH_CODE); + pattern = pattern.replace("999", YEAR_CODE); + // sometimes the number is localized and the above does not have an effect + const yearStr = date.toLocaleDateString(locale, { year: "numeric" }); + return pattern.replace(yearStr, YEAR_CODE); +} + +function getMonthDayPattern(locale: string | undefined, date: Date): string +{ + let pattern = date.toLocaleDateString(locale, { month: "long", day: "numeric"}).toLowerCase(); + // pattern has month name as string or as number + const monthName = date.toLocaleString(locale, { month: "long" }).toLowerCase().trim(); + if (monthName.charAt(monthName.length - 1) == "\u6708") + { + // Chineese-like patterns: + return "M\u6708d\u65e5"; + } + const formatWithoutMonthName = new Intl.DateTimeFormat(locale, { day: "numeric" }); + const replacedMonthName = getGenitiveForName(date, pattern, monthName, formatWithoutMonthName); + pattern = pattern.replace(replacedMonthName, MONTH_CODE); + pattern = pattern.replace("22", DAY_CODE); + const dayStr = formatWithoutMonthName.format(date); + return pattern.replace(dayStr, DAY_CODE); +} + +function getShortDatePattern(locale: string | undefined): string +{ + if (locale?.substring(0, 2) == "fa") + { + // persian calendar is shifted and it has no lapping dates with + // arabic and gregorian calendars, so that both day and month would be < 10 + return "yyyy/M/d"; + } + const year = 2014; + const month = 1; + const day = 2; + const date = new Date(year, month - 1, day); // arabic: 1/3/1435 + const longYearStr = "2014"; + const shortYearStr = "14"; + const longMonthStr = "01"; + const shortMonthStr = "1"; + const longDayStr = "02"; + const shortDayStr = "2"; + let pattern = date.toLocaleDateString(locale, {dateStyle: "short"}); + // each date part might be in localized numbers or standard arabic numbers + // toLocaleDateString returns not compatible data, + // e.g. { dateStyle: "short" } sometimes contains localized year number + // while { year: "numeric" } contains non-localized year number and vice versa + if (pattern.includes(shortYearStr)) + { + pattern = pattern.replace(longYearStr, YEAR_CODE); + pattern = pattern.replace(shortYearStr, YEAR_CODE); + } + else + { + const yearStr = date.toLocaleDateString(locale, { year: "numeric" }); + const yearStrShort = yearStr.substring(yearStr.length - 2, yearStr.length); + pattern = pattern.replace(yearStr, YEAR_CODE); + if (yearStrShort) + pattern = pattern.replace(yearStrShort, YEAR_CODE); + } + + if (pattern.includes(shortMonthStr)) + { + pattern = pattern.replace(longMonthStr, "MM"); + pattern = pattern.replace(shortMonthStr, "M"); + } + else + { + const monthStr = date.toLocaleDateString(locale, { month: "numeric" }); + const localizedMonthCode = monthStr.length == 1 ? "M" : "MM"; + pattern = pattern.replace(monthStr, localizedMonthCode); + } + + if (pattern.includes(shortDayStr)) + { + pattern = pattern.replace(longDayStr, "dd"); + pattern = pattern.replace(shortDayStr, "d"); + } + else + { + const dayStr = date.toLocaleDateString(locale, { day: "numeric" }); + const localizedDayCode = dayStr.length == 1 ? "d" : "dd"; + pattern = pattern.replace(dayStr, localizedDayCode); + } + + + return pattern; +} + +function getLongDatePattern(locale: string | undefined, date: Date): string +{ + if (locale == "th-TH") + { + // cannot be caught with regexes + return "ddddที่ d MMMM g yyyy"; + } + let pattern = new Intl.DateTimeFormat(locale, { weekday: "long", year: "numeric", month: "long", day: "numeric"}).format(date).toLowerCase(); + const monthName = date.toLocaleString(locale, { month: "long" }).trim().toLowerCase(); + + // pattern has month name as string or as number + const monthSuffix = monthName.charAt(monthName.length - 1); + if (monthSuffix == "\u6708" || monthSuffix == "\uc6d4") + { + // Asian-like patterns: + const shortMonthName = date.toLocaleString(locale, { month: "short" }); + pattern = pattern.replace(shortMonthName, `M${monthSuffix}`); + } + else + { + const replacedMonthName = getGenitiveForName(date, pattern, monthName, new Intl.DateTimeFormat(locale, { weekday: "long", year: "numeric", day: "numeric"})); + pattern = pattern.replace(replacedMonthName, MONTH_CODE); + } + pattern = pattern.replace("999", YEAR_CODE); + // sometimes the number is localized and the above does not have an effect, + // so additionally, we need to do: + const yearStr = date.toLocaleDateString(locale, { year: "numeric" }); + pattern = pattern.replace(yearStr, YEAR_CODE); + const weekday = date.toLocaleDateString(locale, { weekday: "long" }).toLowerCase(); + const replacedWeekday = getGenitiveForName(date, pattern, weekday, new Intl.DateTimeFormat(locale, { year: "numeric", month: "long", day: "numeric"})); + pattern = pattern.replace(replacedWeekday, "dddd"); + pattern = pattern.replace("22", DAY_CODE); + const dayStr = date.toLocaleDateString(locale, { day: "numeric" }); // should we replace it for localized digits? + return pattern.replace(dayStr, DAY_CODE); +} + +function getGenitiveForName(date: Date, pattern: string, name: string, formatWithoutName: Intl.DateTimeFormat) +{ + let genitiveName = name; + const nameStart = pattern.indexOf(name); + if (nameStart == -1 || + // genitive month name can include monthName and monthName can include spaces, e.g. "tháng 11":, so we cannot use pattern.includes() or pattern.split(" ").includes() + (nameStart != -1 && pattern.length > nameStart + name.length && pattern[nameStart + name.length] != " " && pattern[nameStart + name.length] != "," && pattern[nameStart + name.length] != "\u060c")) + { + // needs to be in Genitive form to be useful + // e.g. + // pattern = '999 m. lapkričio 22 d., šeštadienis', + // patternWithoutName = '999 2, šeštadienis', + // name = 'lapkritis' + // genitiveName = 'lapkričio' + const patternWithoutName = formatWithoutName.format(date).toLowerCase(); + genitiveName = pattern.split(/,| /).filter(x => !patternWithoutName.split(/,| /).includes(x) && x[0] == name[0])[0]; + } + return genitiveName; +} + +function getDayNames(locale: string | undefined) : { long: string[], abbreviated: string[], shortest: string[] } +{ + const weekDay = new Date(2023, 5, 25); // Sunday + const dayNames = []; + const dayNamesAbb = []; + const dayNamesSS = []; + for(let i=0; i<7; i++) + { + dayNames[i] = weekDay.toLocaleDateString(locale, { weekday: "long" }); + dayNamesAbb[i] = weekDay.toLocaleDateString(locale, { weekday: "short" }); + dayNamesSS[i] = weekDay.toLocaleDateString(locale, { weekday: "narrow" }); + weekDay.setDate(weekDay.getDate() + 1); + } + return {long: dayNames, abbreviated: dayNamesAbb, shortest: dayNamesSS }; +} + +function getMonthNames(locale: string | undefined) : { long: string[], abbreviated: string[], longGenitive: string[], abbreviatedGenitive: string[] } +{ + // some calendars have the first month on non-0 index in JS + // first month: Muharram ("ar") or Farwardin ("fa") or January + const localeLang = locale ? locale.split("-")[0] : ""; + const firstMonthShift = localeLang == "ar" ? 8 : localeLang == "fa" ? 3 : 0; + const date = new Date(2021, firstMonthShift, 1); + const months: string[] = []; + const monthsAbb: string[] = []; + const monthsGen: string[] = []; + const monthsAbbGen: string[] = []; + let isChineeseStyle, isShortFormBroken; + for(let i = firstMonthShift; i < 12 + firstMonthShift; i++) + { + const monthCnt = i % 12; + date.setMonth(monthCnt); + + const monthNameLong = date.toLocaleDateString(locale, { month: "long" }); + const monthNameShort = date.toLocaleDateString(locale, { month: "short" }); + months[i - firstMonthShift] = monthNameLong; + monthsAbb[i - firstMonthShift] = monthNameShort; + // for Genitive forms: + isChineeseStyle = isChineeseStyle ?? monthNameLong.charAt(monthNameLong.length - 1) == "\u6708"; + if (isChineeseStyle) + { + // for Chinese-like calendar's Genitive = Nominative + monthsGen[i - firstMonthShift] = monthNameLong; + monthsAbbGen[i - firstMonthShift] = monthNameShort; + continue; + } + const formatWithoutMonthName = new Intl.DateTimeFormat(locale, { day: "numeric" }); + const monthWithDayLong = date.toLocaleDateString(locale, { month: "long", day: "numeric"}); + monthsGen[i - firstMonthShift] = getGenitiveForName(date, monthWithDayLong, monthNameLong, formatWithoutMonthName); + isShortFormBroken = isShortFormBroken ?? /^\d+$/.test(monthNameShort); + if (isShortFormBroken) + { + // for buggy locales e.g. lt-LT, short month contains only number instead of string + // we leave Genitive = Nominative + monthsAbbGen[i - firstMonthShift] = monthNameShort; + continue; + } + const monthWithDayShort = date.toLocaleDateString(locale, { month: "short", day: "numeric"}); + monthsAbbGen[i - firstMonthShift] = getGenitiveForName(date, monthWithDayShort, monthNameShort, formatWithoutMonthName); + } + return {long: months, abbreviated: monthsAbb, longGenitive: monthsGen, abbreviatedGenitive: monthsAbbGen }; +} + +// .NET expects that only the Japanese calendars have more than 1 era. +// So for other calendars, only return the latest era. +function getEraNames(date: Date, locale: string | undefined, calendarId: number) : { eraNames: string, abbreviatedEraNames: string} +{ + if (shouldBePopulatedByManagedCode(calendarId)) + { + // managed code already handles these calendars, + // so empty strings will get overwritten in + // InitializeEraNames/InitializeAbbreviatedEraNames + return { + eraNames: "", + abbreviatedEraNames: "" + }; + } + const yearStr = date.toLocaleDateString(locale, { year: "numeric" }); + const dayStr = date.toLocaleDateString(locale, { day: "numeric" }); + const eraDate = date.toLocaleDateString(locale, { era: "short" }); + const shortEraDate = date.toLocaleDateString(locale, { era: "narrow" }); + + const eraDateParts = eraDate.includes(yearStr) ? + getEraDateParts(yearStr) : + getEraDateParts(date.getFullYear().toString()); + + return { + eraNames: getEraFromDateParts(eraDateParts.eraDateParts, eraDateParts.ignoredPart), + abbreviatedEraNames: getEraFromDateParts(eraDateParts.abbrEraDateParts, eraDateParts.ignoredPart) + }; + + function shouldBePopulatedByManagedCode(calendarId: number) + { + return (calendarId > 1 && calendarId < 15) || calendarId == 22 || calendarId == 23; + } + + function getEraFromDateParts(dateParts: string[], ignoredPart: string) : string + { + const regex = new RegExp(`^((?!${ignoredPart}|[0-9]).)*$`); + const filteredEra = dateParts.filter(part => regex.test(part)); + if (filteredEra.length == 0) + throw new Error(`Internal error, era for locale ${locale} was in non-standard format.`); + return filteredEra[0].trim(); + } + + function getEraDateParts(yearStr: string) + { + if (eraDate.startsWith(yearStr) || eraDate.endsWith(yearStr)) + { + return { + eraDateParts: eraDate.split(dayStr), + abbrEraDateParts: shortEraDate.split(dayStr), + ignoredPart: yearStr, + }; + } + return { + eraDateParts: eraDate.split(yearStr), + abbrEraDateParts: shortEraDate.split(yearStr), + ignoredPart: dayStr, + }; + } +} \ No newline at end of file diff --git a/src/mono/wasm/runtime/hybrid-globalization/culture-info.ts b/src/mono/wasm/runtime/hybrid-globalization/culture-info.ts new file mode 100644 index 0000000000000..226cfcb541739 --- /dev/null +++ b/src/mono/wasm/runtime/hybrid-globalization/culture-info.ts @@ -0,0 +1,130 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import { wrap_error_root, wrap_no_error_root } from "../invoke-js"; +import { mono_wasm_new_external_root } from "../roots"; +import { monoStringToString, stringToUTF16 } from "../strings"; +import { Int32Ptr } from "../types/emscripten"; +import { MonoObject, MonoObjectRef, MonoString, MonoStringRef } from "../types/internal"; +import { OUTER_SEPARATOR, normalizeLocale } from "./helpers"; + +export function mono_wasm_get_culture_info(culture: MonoStringRef, dst: number, dstLength: number, isException: Int32Ptr, exAddress: MonoObjectRef): number +{ + const cultureRoot = mono_wasm_new_external_root(culture), + exceptionRoot = mono_wasm_new_external_root(exAddress); + try { + const cultureName = monoStringToString(cultureRoot); + const cultureInfo = { + AmDesignator: "", + PmDesignator: "", + LongTimePattern: "", + ShortTimePattern: "" + }; + const canonicalLocale = normalizeLocale(cultureName); + const designators = getAmPmDesignators(canonicalLocale); + cultureInfo.AmDesignator = designators.am; + cultureInfo.PmDesignator = designators.pm; + cultureInfo.LongTimePattern = getLongTimePattern(canonicalLocale, designators); + cultureInfo.ShortTimePattern = getShortTimePattern(cultureInfo.LongTimePattern); + const result = Object.values(cultureInfo).join(OUTER_SEPARATOR); + if (result.length > dstLength) + { + throw new Error(`Culture info exceeds length of ${dstLength}.`); + } + stringToUTF16(dst, dst + 2 * result.length, result); + wrap_no_error_root(isException, exceptionRoot); + return result.length; + } + catch (ex: any) { + wrap_error_root(isException, ex, exceptionRoot); + return -1; + } + finally { + cultureRoot.release(); + exceptionRoot.release(); + } +} + +function getAmPmDesignators(locale: any) +{ + const pmTime = new Date("August 19, 1975 12:15:30"); // do not change, some PM hours result in hour digits change, e.g. 13 -> 01 or 1 + const amTime = new Date("August 19, 1975 11:15:30"); // do not change, some AM hours result in hour digits change, e.g. 9 -> 09 + const pmDesignator = getDesignator(pmTime, locale); + const amDesignator = getDesignator(amTime, locale); + return { + am: amDesignator, + pm: pmDesignator + }; +} + +function getDesignator(time: Date, locale: string) +{ + const withDesignator = time.toLocaleTimeString(locale, { hourCycle: "h12"}); + const withoutDesignator = time.toLocaleTimeString(locale, { hourCycle: "h24"}); + const designator = withDesignator.replace(withoutDesignator, "").trim(); + if (new RegExp("[0-9]$").test(designator)){ + const designatorParts = withDesignator.split(" ").filter(part => new RegExp("^((?![0-9]).)*$").test(part)); + if (!designatorParts || designatorParts.length == 0) + return ""; + return designatorParts.join(" "); + } + return designator; +} + +function getLongTimePattern(locale: string | undefined, designators: any) : string +{ + const hourIn24Format = 18; // later hours than 18 have night designators in some locales (instead of AM designator) + const hourIn12Format = 6; + const localizedHour24 = (hourIn24Format).toLocaleString(locale); // not all locales use arabic numbers + const localizedHour12 = (hourIn12Format).toLocaleString(locale); + const pmTime = new Date(`August 19, 1975 ${hourIn24Format}:15:30`); // in the comments, en-US locale is used: + const shortTime = new Intl.DateTimeFormat(locale, { timeStyle: "medium" }); + const shortPmStyle = shortTime.format(pmTime); // 12:15:30 PM + const minutes = pmTime.toLocaleTimeString(locale, { minute: "numeric" }); // 15 + const seconds = pmTime.toLocaleTimeString(locale, { second: "numeric" }); // 30 + let pattern = shortPmStyle.replace(designators.pm, "tt").replace(minutes, "mm").replace(seconds, "ss"); // 12:mm:ss tt + + const isISOStyle = pattern.includes(localizedHour24); // 24h or 12h pattern? + const localized0 = (0).toLocaleString(locale); + const hour12WithPrefix = `${localized0}${localizedHour12}`; // 06 + const amTime = new Date(`August 19, 1975 ${hourIn12Format}:15:30`); + const h12Style = shortTime.format(amTime); + let hourPattern; + if (isISOStyle) // 24h + { + const hasPrefix = h12Style.includes(hour12WithPrefix); + hourPattern = hasPrefix ? "HH" : "H"; + pattern = pattern.replace(localizedHour24, hourPattern); + } + else // 12h + { + const hasPrefix = h12Style.includes(hour12WithPrefix); + hourPattern = hasPrefix ? "hh" : "h"; + pattern = pattern.replace(hasPrefix ? hour12WithPrefix : localizedHour12, hourPattern); + } + + return pattern; +} + +function getShortTimePattern(pattern: string) : string +{ + // remove seconds: + // short dotnet pattern does not contain seconds while JS's pattern always contains them + const secondsIdx = pattern.indexOf("ss"); + if (secondsIdx > 0) + { + const secondsWithSeparator = `${pattern[secondsIdx - 1]}ss`; + // en-US: 12:mm:ss tt -> 12:mm tt; + // fr-CA: 12 h mm min ss s -> 12 h mm min s + const shortPatternNoSecondsDigits = pattern.replace(secondsWithSeparator, ""); + if (shortPatternNoSecondsDigits.length > secondsIdx && shortPatternNoSecondsDigits[shortPatternNoSecondsDigits.length - 1] != "t") + { + pattern = pattern.split(secondsWithSeparator)[0]; + } + else + { + pattern = shortPatternNoSecondsDigits; + } + } + return pattern; +} diff --git a/src/mono/wasm/runtime/hybrid-globalization/helpers.ts b/src/mono/wasm/runtime/hybrid-globalization/helpers.ts new file mode 100644 index 0000000000000..d5b5da45e7dae --- /dev/null +++ b/src/mono/wasm/runtime/hybrid-globalization/helpers.ts @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +export const OUTER_SEPARATOR = "##"; +export const INNER_SEPARATOR = "||"; + +export function normalizeLocale(locale: string | null) +{ + if (!locale) + return undefined; + try + { + locale = locale.toLocaleLowerCase(); + if (locale.includes("zh")) + { + // browser does not recognize "zh-chs" and "zh-cht" as equivalents of "zh-HANS" "zh-HANT", we are helping, otherwise + // it would throw on getCanonicalLocales with "RangeError: Incorrect locale information provided" + locale = locale.replace("chs", "HANS").replace("cht", "HANT"); + } + const canonicalLocales = (Intl as any).getCanonicalLocales(locale.replace("_", "-")); + return canonicalLocales.length > 0 ? canonicalLocales[0] : undefined; + } + catch(ex: any) + { + throw new Error(`Get culture info failed for culture = ${locale} with error: ${ex}`); + } +} \ No newline at end of file diff --git a/src/mono/wasm/runtime/hybrid-globalization/locales.ts b/src/mono/wasm/runtime/hybrid-globalization/locales.ts new file mode 100644 index 0000000000000..98d3755754a13 --- /dev/null +++ b/src/mono/wasm/runtime/hybrid-globalization/locales.ts @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import { wrap_error_root } from "../invoke-js"; +import { mono_wasm_new_external_root } from "../roots"; +import { monoStringToString } from "../strings"; +import { Int32Ptr } from "../types/emscripten"; +import { MonoObject, MonoObjectRef, MonoString, MonoStringRef } from "../types/internal"; +import { normalizeLocale } from "./helpers"; + +export function mono_wasm_get_first_day_of_week(culture: MonoStringRef, isException: Int32Ptr, exAddress: MonoObjectRef): number{ + + const cultureRoot = mono_wasm_new_external_root(culture), + exceptionRoot = mono_wasm_new_external_root(exAddress); + try { + const cultureName = monoStringToString(cultureRoot); + const canonicalLocale = normalizeLocale(cultureName); + return getFirstDayOfWeek(canonicalLocale); + } + catch (ex: any) { + wrap_error_root(isException, ex, exceptionRoot); + return -1; + } + finally { + cultureRoot.release(); + exceptionRoot.release(); + } +} + +export function mono_wasm_get_first_week_of_year(culture: MonoStringRef, isException: Int32Ptr, exAddress: MonoObjectRef): number{ + + const cultureRoot = mono_wasm_new_external_root(culture), + exceptionRoot = mono_wasm_new_external_root(exAddress); + try { + const cultureName = monoStringToString(cultureRoot); + const canonicalLocale = normalizeLocale(cultureName); + return getFirstWeekOfYear(canonicalLocale); + } + catch (ex: any) { + wrap_error_root(isException, ex, exceptionRoot); + return -1; + } + finally { + cultureRoot.release(); + exceptionRoot.release(); + } +} + +function getFirstDayOfWeek(locale: string) +{ + const weekInfo = getWeekInfo(locale); + if (weekInfo) + { + // JS's Sunday == 7 while dotnet's Sunday == 0 + return weekInfo.firstDay == 7 ? 0 : weekInfo.firstDay; + } + // Firefox does not support it rn but we can make a temporary workaround for it, + // that should be removed when it starts being supported: + const saturdayLocales = [ "en-AE", "en-SD", "fa-IR" ]; + if (saturdayLocales.includes(locale)) + { + return 6; + } + const sundayLanguages = [ "zh", "th", "pt", "mr", "ml", "ko", "kn", "ja", "id", "hi", "he", "gu", "fil", "bn", "am", "ar" ]; + const sundayLocales = [ "ta-SG", "ta-IN", "sw-KE", "ms-SG", "fr-CA", "es-MX", "en-US", "en-ZW", "en-ZA", "en-WS", "en-VI", "en-UM", "en-TT", "en-SG", "en-PR", "en-PK", "en-PH", "en-MT", "en-MO", "en-MH", "en-KE", "en-JM", "en-IN", "en-IL", "en-HK", "en-GU", "en-DM", "en-CA", "en-BZ", "en-BW", "en-BS", "en-AU", "en-AS", "en-AG" ]; + const localeLang = locale.split("-")[0]; + if (sundayLanguages.includes(localeLang) || sundayLocales.includes(locale)) + { + return 0; + } + return 1; +} + +function getFirstWeekOfYear(locale: string) +{ + const weekInfo = getWeekInfo(locale); + if (weekInfo) + { + // enum CalendarWeekRule + // FirstDay = 0, // when minimalDays < 4 + // FirstFullWeek = 1, // when miminalDays == 7 + // FirstFourDayWeek = 2 // when miminalDays >= 4 + return weekInfo.minimalDays == 7 ? 1 : + weekInfo.minimalDays < 4 ? 0 : 2; + } + // Firefox does not support it rn but we can make a temporary workaround for it, + // that should be removed when it starts being supported: + const firstFourDayWeekLocales = [ "pt-PT", "fr-CH", "fr-FR", "fr-BE", "es-ES", "en-SE", "en-NL", "en-JE", "en-IM", "en-IE", "en-GI", "en-GG", "en-GB", "en-FJ", "en-FI", "en-DK", "en-DE", "en-CH", "en-BE", "en-AT", "el-GR" ]; + const firstFourDayWeekLanguages = [ "sv", "sk", "ru", "pl", "nl", "no", "lt", "it", "hu", "fi", "et", "de", "da", "cs", "ca", "bg" ]; + const localeLang = locale.split("-")[0]; + if (firstFourDayWeekLocales.includes(locale) || firstFourDayWeekLanguages.includes(localeLang)) + { + return 2; + } + return 0; +} + +function getWeekInfo(locale: string) +{ + try { + // most tools have it implemented as property + return (new Intl.Locale(locale) as any).weekInfo; + } + catch { + try { + // but a few use methods, which is the preferred way + return (new Intl.Locale(locale) as any).getWeekInfo(); + } + catch + { + return undefined; + } + } +} \ No newline at end of file