Skip to content

getLocaleZonedDayOfWeek

  • The core functions, which every industry uses.
getLocaleZonedDayOfWeek(value: string, locale: string | string[]): number | null

Return the locale-relative day-of-week index for a zoned value.

  • 0 = the locale’s first day of week (e.g. Monday for fr-FR, Sunday for pt-BR, Saturday for ar-EG).
  • Resolves the locale’s first day of week via Intl.Locale.prototype.weekInfo.
  • Falls back to Monday if the runtime’s weekInfo data doesn’t resolve a first day for the locale.
  • Returns null if value is not a valid zoned ISO datetime or locale is not a well-formed BCP 47 tag (ECMA-402 IsWellFormedLanguageTag). A well-formed tag with no matching locale data is not an error: it falls back to the host’s default locale, as ECMA-402 ResolveLocale requires.
ParameterTypeDescription
valuestringzoned ISO 8601 datetime string
localestring | string[]BCP 47 locale tag (e.g. “fr-FR”, “pt-BR”, “ar-EG”), 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 null

locale-relative day-of-week index (0–6) or null on invalid input

import { getLocaleZonedDayOfWeek } from "@northguild/gmt/zoned/calculate";
getLocaleZonedDayOfWeek("2024-02-25T12:00:00+00:00[UTC]", "pt-BR") // 0 (Sunday)
output 

zoned/calculate/getLocaleZonedDayOfWeek.ts

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.