It is sometimes useful to get the list of months or weekdays in a locale, for example when populating a dropdown menu.
Returns the list of months in the current locale.
You can pass an integer into each of those functions to get a specific month or weekday.
As of 2.13.0 you can pass a bool as the first parameter of the weekday functions. If true, the weekdays will be returned in locale specific order.For instance, in the Arabic locale, Saturday is the first day of the week, thus:
Some locales make special considerations into account when formatting month names. For example, Dutch formats month abbreviations without a trailing period, but only if it's formatting the month between dashes. The method supports passing a format in so that the months will be listed in the proper context.
moment.locale('nl');
And finally, you can combine both the format option and the integer option.