Skip to content

startOfYearMonth

startOfYearMonth(value: string): string

The first day of a year-month, as an ISO date.

  • The lowest year-month, -271821-04, holds only -271821-04-19 to -271821-04-30, so its first day is not a PlainDate and the result is "".
ParameterTypeDescription
valuestringa year-month, YYYY-MM

the ISO date YYYY-MM-01, or "" when value is not a valid year-month or its first day is outside the PlainDate range

import { startOfYearMonth } from "@northguild/gmt/plain/calculate";
startOfYearMonth("2026-10") // "2026-10-01"
output 

plain/calculate/startOfYearMonth.ts

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else:© 2026 NorthGuild, all rights reserved.