imsi imsi imsi imsi - 25 days ago 11
Javascript Question

How to get the date with Frensh formatting

I'm trying to use

moment.js
in my project, what I want is to alert the date in French, I tried this:

alert(moment('2012-10-14', 'YYYY-MM-DD', 'fr', true););


But it alerts it in English, help please.

Answer Source

You need to use something like this:

alert(moment('2012-10-14').format('dddd Do MMMM YYYY'));
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>