Как вычесть один месяц, используя moment.js?
moment().subtract(1, 'months').format('MMM YYYY');
shafeeque
moment().subtract(1, 'months').format('MMM YYYY');
let currentDate = moment(startDate);
while(currentDate < endDate) { // Make sure endDate is also a moment object
// Add the current date - you will want to adapt this
dates.push(currentDate.clone()); // Since .add() will mutate the currentDate object, clone the object when adding it to the array so that it's not affected by the add()
// Prepare for the next iteration
currentDate.add({days: 7});
}