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