MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / daysInMonth

Function daysInMonth

tests/test_code/js/moment/moment.js:888–899  ·  view source on GitHub ↗
(year, month)

Source from the content-addressed store, hash-verified

886 }
887
888 function daysInMonth(year, month) {
889 if (isNaN(year) || isNaN(month)) {
890 return NaN;
891 }
892 var modMonth = mod(month, 12);
893 year += (month - modMonth) / 12;
894 return modMonth === 1
895 ? isLeapYear(year)
896 ? 29
897 : 28
898 : 31 - ((modMonth % 7) % 2);
899 }
900
901 // FORMATTING
902

Callers 4

set$1Function · 0.85
setMonthFunction · 0.85
getDaysInMonthFunction · 0.85
checkOverflowFunction · 0.85

Calls 2

modFunction · 0.85
isLeapYearFunction · 0.85

Tested by

no test coverage detected