Skip to content

mapDaysInMonth

mapDaysInMonth(month: string): string[]

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.
ParameterTypeDescription
monthstringISO PlainYearMonth string (YYYY-MM)

array of ISO PlainDate strings for each day in the month

import { mapDaysInMonth } from "@northguild/gmt/plain/map";
mapDaysInMonth("2024-02") // ["2024-02-01", "2024-02-02", ..., "2024-02-29"]
output 

plain/map/mapDaysInMonth.ts