MCPcopy
hub / github.com/tdewolff/minify / daysInMonth

Function daysInMonth

_benchmarks/sample_moment.js:1055–1066  ·  view source on GitHub ↗
(year, month)

Source from the content-addressed store, hash-verified

1053 }
1054
1055 function daysInMonth(year, month) {
1056 if (isNaN(year) || isNaN(month)) {
1057 return NaN;
1058 }
1059 var modMonth = mod(month, 12);
1060 year += (month - modMonth) / 12;
1061 return modMonth === 1
1062 ? isLeapYear(year)
1063 ? 29
1064 : 28
1065 : 31 - ((modMonth % 7) % 2);
1066 }
1067
1068 // FORMATTING
1069

Callers 3

setMonthFunction · 0.70
getDaysInMonthFunction · 0.70
checkOverflowFunction · 0.70

Calls 3

isNaNFunction · 0.85
modFunction · 0.85
isLeapYearFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…