moment compare two dates that are within 7 days code example
Example 1: moment date difference in days
moment(new Date()).diff(moment(new Date()), 'days') // 0
Example 2: compare two dates using moment
moment('2010-10-20').isAfter('2010-01-01', 'year'); // false
moment('2010-10-20').isAfter('2009-12-31', 'year'); // true