Skip to content

Commit 7867b02

Browse files
ptomatoMs2ger
authored andcommitted
Fix implementations of maxLengthOfMonthCodeInAnyYear
One implementation (in the Persian calendar) has the wrong name so never got invoked. Another implementation (Chinese/Dangi calendars) interpreted the passed-in argument incorrectly. But it would eventually come up with the right answer, after searching 20 years.
1 parent a056783 commit 7867b02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

polyfill/lib/calendar.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ const helperPersian = ObjectAssign({}, nonIsoHelperBase, {
11991199
if (month === 12) return 30;
12001200
return month <= 6 ? 31 : 30;
12011201
},
1202-
maximumLengthOfMonthCodeInAnyYear(monthCode) {
1202+
maxLengthOfMonthCodeInAnyYear(monthCode) {
12031203
const month = +ES.Call(StringPrototypeSlice, monthCode, [1]);
12041204
return month <= 6 ? 31 : 30;
12051205
},
@@ -1761,10 +1761,9 @@ const helperChinese = ObjectAssign({}, nonIsoHelperBase, {
17611761
},
17621762
minimumMonthLength: (/* calendarDate */) => 29,
17631763
maximumMonthLength: (/* calendarDate */) => 30,
1764-
maxLengthOfMonthCodeInAnyYear(calendarDate) {
1764+
maxLengthOfMonthCodeInAnyYear(monthCode) {
17651765
// See note below about ICU4C vs ICU4X. It is possible this override should
17661766
// always return 30.
1767-
const { monthCode } = calendarDate;
17681767
if (
17691768
monthCode === 'M01L' ||
17701769
monthCode === 'M09L' ||

0 commit comments

Comments
 (0)