I\'d like to obtain the list of available locale keys. I can\'t find any documentation on how to do this.
Following method returns list of locales that have been loaded
moment.locales()
Commit id
New feature link
Document link
For getting all list of available locale keys you'll need:
import moment from 'moment/min/moment-with-locales';
then
moment.locales(); // return array of all locales keys
This function doesn't exist currently. It was requested awhile back, and closed in favor of other related functionality. I've reopened the issue.
A good way of viewing an up-to-date list of locales is to look inside the 'node_modules/moment/locale' folder. Then you'll see a js file for each locale and you can even see more details for that locale in the js file.
moment.locales()
returns array of locales like so:
though moment.locale()
returns current active locale, like so: