mapDaysInMonth
Signature
Section titled “Signature”mapDaysInMonth(month: string): string[]import { mapDaysInMonth } from "@northguild/gmt/plain/map";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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
month |
string |
ISO PlainYearMonth string (YYYY-MM) |
Returns
Section titled “Returns”array of ISO PlainDate strings for each day in the month
Examples
Section titled “Examples”mapDaysInMonth("2024-02") // ["2024-02-01", "2024-02-02", ..., "2024-02-29"]mapDaysInMonth("2024-04") // ["2024-04-01", "2024-04-02", ..., "2024-04-30"]mapDaysInMonth("invalid") // []