$ npm install daystamp
Compare the timestamps if they are in one day
const daystamp = require('daystamp');
daystamp.fromDate(Date.now()) === daystamp.fromDate(d);
-
.fromDate(Date d)
: get the day stamp from a Date or timestamp -
.fromNow()
: get the day stamp from now Date
MIT