Converting English Months to French in ACC

cslackl1

21-07-2020

hey!

First run at ACC here, and trying to convert the current date into French months:

 

<%= formatDate(new Date(), "%D %Bi %Y") %>,

 

So instead of 20 July 2020, i would it to say 20 juillet 2020

Accepted Solutions (0)

Answers (3)

Answers (3)

_Manoj_Kumar

MVP

21-07-2020

Hello @cslackl1 ,

 

You can use moment.js in your workflow to achieve this.

 

Just download the moment.js library (from here). Then upload it in Administration > Configuration > JavaScript Codes

 

Then in your workflow you can use this code.

loadLibrary('NAMESPACE:moment.js');
var myDate=formatDate(new Date(), "%D %Bi %Y");
var frenchDate=moment(myDate, 'DDD MMMM YYYY', 'fr');

More Information on date formatting is available here: https://momentjs.com/docs/#:~:text=moment(%2212%2D25%2D,valid%20dates%20over%20invalid%20ones.

Let me know if that works.

wodnicki

MVP

21-07-2020

Hi,

 

Use toLocaleDateString().

 

Thanks,

-Jon