Answers for "moment js check if date is bigger"

1

moment js check if date is greater than

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
Posted by: Guest on September-13-2020
0

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())
Posted by: Guest on November-12-2020

Code answers related to "moment js check if date is bigger"

Code answers related to "Javascript"

Browse Popular Code Answers by Language