Skip to content

endOfYearMonth

endOfYearMonth(value: string): string

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

  • February ends on the 29th in a leap year and on the 28th in any other.
  • The highest year-month, +275760-09, holds only +275760-09-01 to +275760-09-13, so its last day is not a PlainDate and the result is "".
ParameterTypeDescription
valuestringa year-month, YYYY-MM

the ISO date of the last day, or "" when value is not a valid year-month or its last day is outside the PlainDate range

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

plain/calculate/endOfYearMonth.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.