parseMonthFromDate
Playground
call
result
Signature
Section titled “Signature”parseMonthFromDate(value: string): stringimport { parseMonthFromDate } from "@northguild/gmt/plain/parse";Return the month (1-12) for a given ISO 8601 date string.
- Returns zero-padded string for month.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO date string |
Returns
Section titled “Returns”Month (01-12) or “” on invalid input
Examples
Section titled “Examples”parseMonthFromDate("2024-03-15") // "03"parseMonthFromDate("invalid") // ""