clean-jsdoc-theme TypeDoc APIv0.0.0

isBetween

isBetween( date: Date, start: Date, end: Date, inclusive: boolean, ): boolean

Source: date.ts:391

Checks if a date is between two other dates

Parameters

  • date (Date) — Date to check
  • start (Date) — Start of range
  • end (Date) — End of range
  • inclusive (boolean, default: "true") — Whether to include boundaries

Returns

  • boolean — True if date is in range

Example

CODE
const date = new Date('2024-03-15')
const start = new Date('2024-03-01')
const end = new Date('2024-03-31')

isBetween(date, start, end) // true