check if time is greater than moment code example
Example 1: moment check greater than current time
function check() {
var now = moment();
var hourToCheck = (now.day() !== 0)?17:15;
var dateToCheck = now.hour(hourToCheck).minute(30);
return moment().isAfter(dateToCheck);
}
console.log(check())
Example 2: check if date is less than today moment
let diff = moment().diff(new Date('DATE_HERE'))
if(div >= 0) {
//Current date or past date
}
else {
//Future date
}