Fix Adar month name in Hebrew calendar (#16697)
authorTarek Mahmoud Sayed <tarekms@microsoft.com>
Fri, 2 Mar 2018 00:36:39 +0000 (16:36 -0800)
committerGitHub <noreply@github.com>
Fri, 2 Mar 2018 00:36:39 +0000 (16:36 -0800)
The returned data from ICU has 6th month name as 'Adar I' and 7th month name as 'Adar'
We need to adjust that in the list used with non-leap year to have 6th month as 'Adar' and 7th month as 'Adar II'
note that when formatting non-leap year dates, 7th month shouldn't get used at all.

src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs

index 926eaa1..17d6ed7 100644 (file)
@@ -54,6 +54,13 @@ namespace System.Globalization
                 Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13);
                 saLeapYearMonthNames = (string[]) saMonthNames.Clone();
                 saLeapYearMonthNames[6] = leapHebrewMonthName;
+
+                // The returned data from ICU has 6th month name as 'Adar I' and 7th month name as 'Adar'
+                // We need to adjust that in the list used with non-leap year to have 6th month as 'Adar' and 7th month as 'Adar II'
+                // note that when formatting non-leap year dates, 7th month shouldn't get used at all.
+                saMonthNames[5] = saMonthNames[6];
+                saMonthNames[6] = leapHebrewMonthName;
+
             }
             result &= EnumMonthNames(localeName, calendarId, CalendarDataType.AbbrevMonthNames, out this.saAbbrevMonthNames, ref leapHebrewMonthName);
             result &= EnumMonthNames(localeName, calendarId, CalendarDataType.MonthGenitiveNames, out this.saMonthGenitiveNames, ref leapHebrewMonthName);