How to set locale of moment in RC0?


#1

In beta.11 I used the following:

import moment from 'moment';
import 'moment/locale/pt-br';

And it works, in other words, if I do for example:

moment.months();

The months come in pt-br lang, however now in RC0 I can’t manage it to work. It always come in english.

Any solution?


#2

The great @ckaeslin found your solution, see his answer in following post or just change your imports like this:

import moment from 'moment';
import 'moment/src/locale/pt-br';

p.s.: to set the locale/language to moment

 moment().locale(language); // where language is for example 'pt-br' or 'fr' etc.

#3

Thank you a lot :slight_smile: