46
rated 0 times
[
50]
[
4]
/ answers: 1 / hits: 131822
/ 7 Years ago, wed, february 15, 2017, 12:00:00
I use the following code to get startDate and endDate of the last 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 month name ? (January, February, ...)
More From » momentjs