getDaysInYear
Signature
Section titled “Signature”getDaysInYear(value: string): numberimport { getDaysInYear } from "@northguild/gmt/plain/calculate";Return the number of days in the calendar year containing value.
- 365 for a common year, 366 for a leap year.
- Returns null on invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO PlainDate string |
Returns
Section titled “Returns”365 or 366, or null on invalid input
Examples
Section titled “Examples”getDaysInYear("2024-06-15") // 366 (leap year)getDaysInYear("2023-06-15") // 365getDaysInYear("invalid") // null