moment compare date time greater than code example
Example 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
Example 2: momoent isafter or equal$
moment().isSameOrAfter(Moment|String|Number|Date|Array);
moment().isSameOrAfter(Moment|String|Number|Date|Array, String);