ChronosChronos

Compare Date

Check if the provided date is today, tomorrow or yesterday.

isToday

Checks if the given date is today.

Function Signature

function isToday(date: Maybe<DateArgs>): boolean;

Parameters

  • date: The date to check. Can be string, number or Date object.

Note

  • For undefined date argument it uses the current date.
  • Throws TypeError if the provided date is invalid (not parsable into a valid date by DateConstructor).

Returns

true if the date is today, false otherwise

Example Usage

playground.ts

isTomorrow

Checks if the given date is tomorrow.

Function Signature

function isTomorrow(date: Maybe<DateArgs>): boolean;

Parameters

  • date: The date to check. Can be string, number or Date object.

Note

  • For undefined date argument it uses the current date.
  • Throws TypeError if the provided date is invalid (not parsable into a valid date by DateConstructor).

Returns

true if the date is tomorrow, false otherwise

Example Usage

playground.ts

isYesterday

Checks if the given date is yesterday.

Function Signature

function isYesterday(date: Maybe<DateArgs>): boolean;

Parameters

  • date: The date to check. Can be string, number or Date object.

Note

  • For undefined date argument it uses the current date.
  • Throws TypeError if the provided date is invalid (not parsable into a valid date by DateConstructor).

Returns

true if the date is yesterday, false otherwise

Example Usage

playground.ts

Last updated: Sun, Jun 28, 2026 04:11:49AM (UTC)

On this page