getDaysInYearMonth
Signature
Section titled “Signature”getDaysInYearMonth(value: string): number | nullReturn the number of days in a year-month.
- 28–31 depending on the month; February varies by leap year.
- The two limit months,
-271821-04and+275760-09, have 30 days, though Temporal holds only part of each. - Returns null on invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | a year-month, YYYY-MM |
Returns
Section titled “Returns”number of days in the month (28-31), or null on invalid input
Examples
Section titled “Examples”import { getDaysInYearMonth } from "@northguild/gmt/plain/calculate";
getDaysInYearMonth("2024-02") // 29 (leap year)Source
Section titled “Source”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.