@spa-tools/utilities
isTomorrow()
The isTomorrow()
function checks if a date value equates to a date that is tomorrow.
Usage
import { isTomorrow } from '@spa-tools/utilities';
const tomorrowDate = new Date();
tomorrowDate.setDate(tomorrowDate.getDate() + 1);
console.log(isTomorrow(tomorrowDate));
// --> true
console.log(isTomorrow('2080-12-31'));
// --> false
Arguments
Name | Type | Required? | Description |
---|---|---|---|
date | string | number | Date | yes | The date value to check as either date string, timestamp integer, or date object |
Returns
boolean
- If value of date
equates to a date that is tomorrow then returns true
else returns false
.