isBusinessDay
Signature
Section titled “Signature”isBusinessDay(value: string): booleanimport { isBusinessDay } from "@northguild/gmt/plain/compare";Return true when value falls on a Monday–Friday ISO business day.
- Uses the fixed ISO Monday–Friday business-day boundary (Mon=1 … Fri=5), matching the definition used by
addBusinessDays/subtractBusinessDays. - Locale-agnostic: no
Intl.Localelookup and no holiday calendar. - Returns false if
valueis invalid. This is the locale-agnostic complement to the locale-awareisWeekend:isWeekendresolves weekend days per locale viaIntl.Locale.prototype.weekInfo, whereasisBusinessDayalways treats Monday–Friday as business days regardless of locale.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO PlainDate string |
Returns
Section titled “Returns”true if value is a Monday–Friday business day, false on invalid input
Examples
Section titled “Examples”isBusinessDay("2024-02-05") // true (Monday)isBusinessDay("2024-02-10") // false (Saturday)isBusinessDay("2024-02-04") // false (Sunday)isBusinessDay("invalid") // false