I am trying to use moment.js to create an array of the next 12 months, starting from the current month. For example, let's say the current month is December:
var monthsArray = [
"December",
"January",
"February",
"March",
[...]
"November"
]
However, my current implementation simply lists all 12 months of a year without taking into account a specific starting month.
var count = 0;
var months = [];
while (count < 12)
months.push(moment().month(count++).format("MMMM"));
I believe I can determine the user's current month with:
_private.userMonth = moment().format('MMMM');
Could someone help me figure out how to modify this code to generate an array of months starting from the current month?