isWeekend
Signature
Section titled “Signature”isWeekend(value: string, locale: string | string[]): booleanReturn true when value falls on a weekend day for locale.
- Uses
Intl.Locale.prototype.weekInfoto resolve which ISO weekday numbers count as “weekend” for the locale (e.g. fr-FR: Sat/Sun, he-IL/ar-SA: Fri/Sat, hi-IN: Sun). - Falls back to Saturday/Sunday if the runtime’s
weekInfodata doesn’t resolve a weekend for the locale. - Returns false if
valueis invalid orlocaleis 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 |
|---|---|---|
value | string | ISO PlainDate string |
locale | string | string[] | BCP 47 locale tag (e.g. “fr-FR”, “he-IL”), 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 false |
Returns
Section titled “Returns”true if value is a weekend day in locale, false on invalid input
Examples
Section titled “Examples”import { isWeekend } from "@northguild/gmt/plain/compare";
isWeekend("2024-02-03", "fr-FR") // true (Saturday, fr-FR weekend is Sat/Sun)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.