Skip to main content

Function: daysInMonth()

daysInMonth(year, month): number

Defined in: src/lib/dates/index.ts:42

Number of days in a given month (handles leap years).

Parameters

year

number

Full year (used to resolve February in leap years).

month

number

Month, 1-12 (1-indexed, as in CalendarDate).

Returns

number

The last day-of-month number, e.g. 28-31 for normal months, 29 for February in a leap year.