Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #moment #js #check #date #greater
ADD COMMENT
Topic
Name
4+2 =