Search code examples
angulartypescriptlocalizationangular2-moment

Angular: Changing locale in moment has no effect


I use angular2-moment for handling dates in my app. I have one component that is used like datepicker with help of moment, now I am doing localization and I am stuck with localizing moment. I wrote:

console.log(moment().locale('de').format('LLLL'));

in my constructor to check but I still get english version. Is there any special imports I need to do so this will work?


Solution

  • It worked after I added:

    import * as moment from 'moment';
    import 'moment/min/locales';