moment(endDate).subtract(1, 'month') code example Example: moment(endDate).subtract(1, 'month') moment().subtract(7, 'days');