I am building something with moment and nodejs, but for some reason, the locales don't get loaded. Here is some code:
import moment from 'moment'
moment.locale('fr');
console.log(moment.locales());
So the console.log only returns the en
locale so I suppose that the other locales aren't loaded.
However, the documentation says:
If there is a locale file in moment-root/locale/ named after that key, the first call to moment.locale will load it.
When I check in my node_modules/moment/locale
, I have indeed a fr.js
file.
So what am I doing wrong? Am I missing something to load my locales?
Thanks a lot for your help!
EDIT: I am using version ^2.14.1
of momentjs