check if time is greater than javascript

JavaScript
function check() {
  var now = moment();
  var hourToCheck = (now.day() !== 0)?17:15;
  console.log(hourToCheck)
  var dateToCheck = now.hour(hourToCheck).minute(30);
  
  return moment().isAfter(dateToCheck);
}

console.log(check())
Source

Also in JavaScript: