getLocaleMonthNames
Signature
Section titled “Signature”getLocaleMonthNames(locale: string, style?: LocaleNameStyle): string[]import { getLocaleMonthNames } from "@northguild/gmt/plain/locale";Return the 12 Gregorian calendar-month names for a locale, in calendar
- order (January first, December last — not alphabetical).
- Uses the host runtime’s
Intldata viaTemporal.PlainDate, so output depends on the runtime’s ICU build (full-ICU runtimes localize every locale; partial-ICU runtimes fall back to English). - Restricted to the Gregorian calendar; non-Gregorian calendar variants are out of scope for this function.
- Returns
[]iflocaleis not a valid BCP 47 tag.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
locale |
string |
BCP 47 locale tag (e.g. “en-US”, “fr-FR”, “ar-SA”) |
style |
LocaleNameStyle |
Optional name style: "long" (default), "short", or "narrow" |
Returns
Section titled “Returns”12-element array of month names in calendar order, or [] on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”getLocaleMonthNames("en-US") // ["January", "February", ... "December"]getLocaleMonthNames("de-DE", "short") // ["Jan", "Feb", "Mär", ... "Dez"]getLocaleMonthNames("fr-FR", "narrow") // ["J", "F", "M", ... "D"]getLocaleMonthNames("not-a-locale") // []