I want to get month name from two digit month number (ex- 09). I tried with this code. But it doesn\'t work. The code give current month name only. What are the correct code for
You want to pass the month when you create the Moment object:
var formattedMonth = moment('09', 'MM').format('MMMM'); // September
moment(
'09', // Desired month
'MM' // Tells MomentJs the number is a reference to month
).format('MMMM') // Formats month as name