MCPcopy
hub / github.com/npmx-dev/npmx.dev / daysInMonth

Function daysInMonth

app/utils/date.ts:18–20  ·  view source on GitHub ↗
(year: number, month: number)

Source from the content-addressed store, hash-verified

16}
17
18export function daysInMonth(year: number, month: number): number {
19 return new Date(Date.UTC(year, month + 1, 0)).getUTCDate()
20}
21
22export function daysInYear(year: number): number {
23 return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0) ? 366 : 365

Callers 2

date.spec.tsFile · 0.90
buildMonthlyEvolutionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected