Answers for "moment js check if date is greater than"

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
0

momoent isafter or equal$

moment().isSameOrAfter(Moment|String|Number|Date|Array);
moment().isSameOrAfter(Moment|String|Number|Date|Array, String);
Posted by: Guest on January-04-2021

Code answers related to "moment js check if date is greater than"

Code answers related to "Javascript"

Browse Popular Code Answers by Language