isWithinRange

Commons
stable

Returns true when a date is strictly after range[0] and strictly before range[1]. Both bounds are exclusive.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
The date to test against the range.
range
required
[Date, Date]
A two-element tuple [start, end]. Both bounds are exclusive (strict comparison).

API

Return value

The value returned by this util.

true when date > range[0] && date < range[1].

Usage

Examples

Ready-to-paste usage snippets.

Range inclusion check

typescript