Skip to content

Commit d87ed96

Browse files
committed
Polyfill: Make buildMonthCode less opaque
Split out some things into local variables for readability. UPSTREAM_COMMIT=8a790146e505254fbbeb93b1d5647aa562fff63f
1 parent 07adf1e commit d87ed96

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/calendar.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,10 @@ function monthCodeNumberPart(monthCode: string) {
417417
return month;
418418
}
419419

420-
function buildMonthCode(month: number | string, leap = false) {
421-
return `M${Call(StringPrototypePadStart, `${month}`, [2, '0'])}${leap ? 'L' : ''}`;
420+
function buildMonthCode(month: number, leap = false) {
421+
const digitPart = Call(StringPrototypePadStart, `${month}`, [2, '0']);
422+
const leapMarker = leap ? 'L' : '';
423+
return `M${digitPart}${leapMarker}`;
422424
}
423425

424426
/**

0 commit comments

Comments
 (0)