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
2011
i have tried this below
I needed an array with months number and months name to display them in ng-optiosn, so I extended a little bit Klaster_1's solution.
Array.apply(0, Array(12)).map( function(_,i){ var elem ={}; elem.id = parseInt(i+1); elem.name = moment().month(i).format('MMM'); return elem; } )