Answers for "check if date is less than today moment"

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

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
}
Posted by: Guest on April-01-2021

Code answers related to "check if date is less than today moment"

Code answers related to "Javascript"

Browse Popular Code Answers by Language