Skip to content

getDaysInMonth

  • The core functions, which every industry uses.
getDaysInMonth(value: string): number | null

Return the number of days in the month containing value.

  • 28–31 depending on the month; February varies by leap year.
  • Returns null on invalid input.
ParameterTypeDescription
valuestringISO PlainDate string

number of days in the month (28-31), or null on invalid input

import { getDaysInMonth } from "@northguild/gmt/plain/calculate";
getDaysInMonth("2024-02-15") // 29 (leap year)
output 

plain/calculate/getDaysInMonth.ts

Accessibility
© 2026 NorthGuild · Licences

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.