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())
let A = moment('2020-01-02');
let B = moment('2020-01-01');
let C = moment('2020-01-03');
console.log(A.diff(B, 'days'));// => 1
console.log(A.diff(C, 'days'));// => -1