lundi 8 juin 2020

How to load locale to moment in ember js?

config/environment.js

moment: {
        allowEmpty: true,
        includeTimezone: 'all',
        includeLocales: true
      }

component.js

import Ember from 'ember';
import moment from 'moment';
...
months: computed(function() {
    return moment.monthsShort();
  })

Here

moment.locale('en')
>>"en"

works as expected...
But When we change locale its not working..

moment.locale('en')
>>"en"

I think the locales are not loaded ....How to load them?
Dependencies

"moment": "2.18.1"
"ember-moment" : "7.4.1"



Aucun commentaire:

Enregistrer un commentaire