new date () diff moment js code example
Example 1: moment diff
const dateDifference = moment(date1).diff(moment(date2))
Example 2: moment diff
var a = moment([2007, 0, 29]);
var b = moment([2007, 0, 28]);
a.diff(b, 'days') // 1
const dateDifference = moment(date1).diff(moment(date2))
var a = moment([2007, 0, 29]);
var b = moment([2007, 0, 28]);
a.diff(b, 'days') // 1