Converting English Months to French in ACC

Avatar

Avatar

cslackl1

Avatar

cslackl1

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)

Avatar

Avatar

_Manoj_Kumar

MVP

Avatar

_Manoj_Kumar

MVP

_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.

Avatar

Avatar

Sukrity_Wadhwa

Employee

Avatar

Sukrity_Wadhwa

Employee

Sukrity_Wadhwa
Employee

28-07-2020

@_Manoj_Kumar @wodnicki Can any of you further help with @cslackl1 's query?
Thanks!

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

21-07-2020

Hi,

 

Use toLocaleDateString().

 

Thanks,

-Jon