Skip to main content

Function: addToRange()

addToRange(date, initialRange, min, max, required): DateRange | undefined

Add a day to an existing range.

The returned range takes in account the undefined values and if the added day is already present in the range.

Parameters

ParameterTypeDefault valueDescription
dateDateundefinedThe date to add to the range.
initialRangeundefined | DateRangeundefinedThe range where to add date.
minnumber0-
maxnumber0-
requiredbooleanfalse-

Returns

DateRange | undefined

Defined in

src/utils/addToRange.ts:12