Skip to main content

Function: rangeContainsModifiers()

rangeContainsModifiers(range, modifiers, dateLib): boolean

Returns whether a range contains dates that match the given modifiers.

const range: DateRange = {
from: new Date(2021, 12, 21),
to: new Date(2021, 12, 30)
};
const matcher1: Date = new Date(2021, 12, 21);
const matcher2: DateRange = {
from: new Date(2022, 5, 1),
to: new Date(2022, 5, 23)
};
rangeContainsModifiers(range, [matcher1, matcher2]); // true, since matcher1 is in the date.

Parameters

ParameterTypeDefault value
range{ from: Date; to: Date; }undefined
range.fromDateundefined
range.toDateundefined
modifiersMatcher | Matcher[]undefined
dateLibDateLibdefaultDateLib

Returns

boolean

Since

9.2.2

Defined in

src/utils/rangeContainsModifiers.ts:36