Skip to content

Commit ff3f7ca

Browse files
rednebptomato
authored andcommitted
polyfill: fix wrong calculation of ISO week number
1 parent bf3510a commit ff3f7ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

polyfill/lib/ecmascript.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ export const ES = ObjectAssign({}, ES2020, {
20282028
const week = MathFloor((doy - dow + 10) / 7);
20292029

20302030
if (week < 1) {
2031-
if (doj === (ES.LeapYear(year) ? 5 : 6)) {
2031+
if (doj === 5 || (doj === 6 && ES.LeapYear(year - 1))) {
20322032
return 53;
20332033
} else {
20342034
return 52;

0 commit comments

Comments
 (0)