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 bestring,numberorDateobject.
Note
- For
undefineddate argument it uses the current date. - Throws
TypeErrorif the provided date is invalid (not parsable into a valid date byDateConstructor).
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 bestring,numberorDateobject.
Note
- For
undefineddate argument it uses the current date. - Throws
TypeErrorif the provided date is invalid (not parsable into a valid date byDateConstructor).
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 bestring,numberorDateobject.
Note
- For
undefineddate argument it uses the current date. - Throws
TypeErrorif the provided date is invalid (not parsable into a valid date byDateConstructor).
Returns
true if the date is yesterday, false otherwise
Example Usage
playground.ts
Last updated: Sun, Jun 28, 2026 04:11:49AM (UTC)
