Skip to main content

Function: rangeContainsDayOfWeek()

rangeContainsDayOfWeek(range, dayOfWeek, dateLib): boolean

Returns whether a date range contains one or more days of the week.

const range: DateRange = {
from: new Date(2024, 8, 1), // Sunday
to: new Date(2024, 8, 6) // Thursday
};
rangeContainsDayOfWeek(date, 1); // true: contains range contains Monday

Parameters​

ParameterTypeDefault value
rangeobjectundefined
range.fromDateundefined
range.toDateundefined
dayOfWeeknumber | number[]undefined
dateLibDateLibdefaultDateLib

Returns​

boolean

Since​

9.2.2

Defined in​

src/utils/rangeContainsDayOfWeek.ts:17