vincent15000's avatar

momentjs in french ?

Hello,

I'm searching for hours how to get moment in French.

import moment from 'moment';
import 'moment/locale/fr';

moment.locale('fr');

...

<div>{{ $moment(props.event.start_date).format('DD MMMM') }}</div>

<div>{{ $moment(props.event.start_date).locale('fr').format('DD MMMM') }}</div>

The date is always written in English.

What am I missing ?

UPDATED => I just notices that the only language available is en (console.log(moment.locales());). I checked in the moment directory in the node modules and the fr.js file is present.

Any idea ?

Thanks for your help.

V

0 likes
1 reply
vincent15000's avatar
vincent15000
OP
Best Answer
Level 63

I just found how to do.

I need to load the package with the locales.

import moment from 'moment/min/moment-with-locales';

Please or to participate in this conversation.