Created Example For One hour Refer This and Then Change it to 24 Hours
const OneHourAgo= (date) => {
const hour= 1000 * 60 * 60;
const hourago= Date.now() - hour;
return date > hourago;
}
Simple One:-
var OneDay = new Date().getTime() + (1 * 24 * 60 * 60 * 1000)
day hour min sec msec
if (yourDate < OneDay) {
// The yourDate time is less than 1 days from now
}
else if (yourDate >= OneDay) {
// The yourDate time is exactly/more than 1 days from now
}