Skip to content

isTomorrow

The isTomorrow function checks if a date corresponds to tomorrow.

Syntax

typescript
isTomorrow(date: Date): boolean;

Parameters

NameTypeDescription
dateDateDate to check

Returns

TypeDescription
booleanTrue if the date is tomorrow

Examples

typescript
isTomorrow(new Date(Date.now() + 24 * 60 * 60 * 1000));
// => true

isTomorrow(new Date("2024-06-11"));
// => depends on the current day

Notes

  • Throws an error if the date is invalid.
  • Useful for validations related to the next day.

References

Released under the MIT License.