-1

I'm trying to use French version of moment, but moment.locale('fr') doesn't work and it doesn't change the language:

console.debug(moment.locale()); 
moment.locale('fr'); 
console.debug(moment.locale());
console.debug(moment.locales());

output:

en
en
TypeError: moment.locales is not a function

gulpfile.js:

var path={
    js:
    [
        {
            src:
                [
                    'bower_components/moment/min/moment.min.js',
                    'bower_components/moment/locale/fr.js',
...
Ace
  • 420
  • 2
  • 8
  • 25

1 Answers1

1

You need to import the french definition

import 'moment/locale/fr'
moment.locale('fr')

https://momentjs.com/docs/#/i18n/loading-into-browser/

user2258152
  • 635
  • 5
  • 13
  • Thanks for your response; however it didn't solve my problem. I already have imported them (moment.min.js and fr.js), I also tried moment-with-locales.js but none works. – Ace Dec 07 '20 at 15:15