isToday

Calendar
stable

Returns true when a Date object falls on the current calendar day in local timezone. Captures the "now" reference at call time (no memoization) to keep the function pure across calls.

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 compare against today. The comparison is delegated to isSameDay(date, new Date()).

API

Return value

The value returned by this util.

true when the date shares the same local calendar day as the current moment; false otherwise.

Usage

Examples

Ready-to-paste usage snippets.

Highlighting today in a calendar cell

typescript