UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

18 lines • 728 B
/** * Return the number of days in a year-month. * * - 28–31 depending on the month; February varies by leap year. * - The two limit months, `-271821-04` and `+275760-09`, have 30 days, though Temporal holds only * part of each. * - Returns null on invalid input. * * @param value a year-month, `YYYY-MM` * @returns number of days in the month (28-31), or null on invalid input * * @example getDaysInYearMonth("2024-02") // 29 (leap year) * @example getDaysInYearMonth("2023-02") // 28 * @example getDaysInYearMonth("2026-04") // 30 * @example getDaysInYearMonth("2026-10") // 31 * @example getDaysInYearMonth("2026-10-01") // null */ export declare function getDaysInYearMonth(value: string): number | null;