var test1 = moment('2018-02-26'); var test2 = moment().subtract(3, 'months') console.log(test1) console.log(test2) console.log(moment(test2-test1).days()