I want to get all months name from year in moment.js
if the year is 2011, then i want to all months name in momentjs
i have tried this below
You can use following function to get a list of Weekdays and Months for listing purpose -
var iIndex,
sArrMonths, sMonth;
for(iIndex = 0; iIndex < 12; iIndex++)
{
sMonth = moment.localeData().months(moment([0,iIndex]), "");
sArrMonths.push(sMonth);
}
You can check live example here - Localized Month and Weekdays List