moment diff 2 dates code example
Example 1: moment diff
const dateDifference = moment(date1).diff(moment(date2))
Example 2: moment date difference in days
moment(new Date()).diff(moment(new Date()), 'days')
Example 3: moment diff
var a = moment([2007, 0, 29]);
var b = moment([2007, 0, 28]);
a.diff(b, 'days')
Example 4: moment js date between two dates
target.isBetween(start, finish, 'days', '()')
target.isBetween(start, finish, 'days', '(]')
target.isBetween(start, finish, 'days', '[)')
target.isBetween(start, finish, 'days', '[]')