I am using the following code to get the startDate and endDate of recent months.
// Previous month var startDateMonthMinusOne = moment().subtract(1, "month").startOf("month").unix(); var endDateMonthMinusOne = moment().subtract(1, "month").endOf("month").unix(); // Previous month - 1 var startDateMonthMinusOne = moment().subtract(2, "month").startOf("month").unix(); var endDateMonthMinusOne = moment().subtract(2, "month").endOf("month").unix();
How can I do to get also the name of the month? (January February,...)
javascript momentjs
wawanopoulos
source share