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
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
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())
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
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us