getDayOfYear
Signature
Section titled “Signature”getDayOfYear(value: string): number | nullReturn the ordinal day-of-year (1-based) for value.
- Jan 1 is 1; Dec 31 is 365 (common year) or 366 (leap year).
- Returns null on invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | ISO PlainDate string |
Returns
Section titled “Returns”1-366, or null on invalid input
Examples
Section titled “Examples”import { getDayOfYear } from "@northguild/gmt/plain/calculate";
getDayOfYear("2024-01-01") // 1