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.

15 lines • 657 B
/** * Return an array of ISO PlainDate strings for every day in the given year-month. * * - Generates array of dates for the specified month. * - Validates input matches the year-month format exactly. * - Returns [] for invalid input. * * @param month ISO PlainYearMonth string (YYYY-MM) * @returns array of ISO PlainDate strings for each day in the month * * @example mapDaysInMonth("2024-02") // ["2024-02-01", "2024-02-02", ..., "2024-02-29"] * @example mapDaysInMonth("2024-04") // ["2024-04-01", "2024-04-02", ..., "2024-04-30"] * @example mapDaysInMonth("invalid") // [] */ export declare function mapDaysInMonth(month: string): string[];