getLocaleMeridiems
Signature
Section titled “Signature”getLocaleMeridiems(locale: string | string[]): string[]Return a locale’s AM/PM (day-period) labels as [AM-label, PM-label].
- Labels are locale-varying:
en-GB→["am", "pm"],zh-CN→["上午", "下午"],ar-SA→["ص", "م"],sv-SE→["fm", "em"],en-US→["AM", "PM"]. - Uses the host runtime’s
Intldata viaIntl.DateTimeFormat, so output depends on the runtime’s ICU build. - Returns
[]iflocaleis not a well-formed BCP 47 tag (ECMA-402IsWellFormedLanguageTag). A well-formed tag with no matching locale data is not an error: it falls back to the host’s default locale, as ECMA-402ResolveLocalerequires.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
locale | string | string[] | BCP 47 locale tag (e.g. “fr-FR”, “ar-SA”, “en-US”), or a preference list of tags (ECMA-402; the first with locale data is read). Required: omitted, or an empty list (which ECMA-402 would resolve to the host default), returns [] |
Returns
Section titled “Returns”2-element [AM-label, PM-label] array, or [] on invalid input
Examples
Section titled “Examples”import { getLocaleMeridiems } from "@northguild/gmt/plain/locale";
getLocaleMeridiems("ar-EG") // ["ص", "م"]Source
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
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.