Expand my Community achievements bar.

SOLVED

How can I change the date format in an email delivery (field from additional data)

Avatar

Level 2

Hi,

 

I would like to change the date format in my email delivery. How can I do that?

It is a personalisation field from Additional Data. Now it is displayed as DD/MM/YYYY. I would like to change this to DD-MM-YYYY or dd-MMMM-YYYY (so in Dutch: 2 mei 2018). And are other languages also supported?  

 

email delivery date.png

 

Same question for using an amount: I would like to display it in Dutch (decimal separator comma, thousands separator is a dot or none. 

How can I apply that on a personalisation field?

 

Kind regards,

Björn

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Bjorn,

 

For the date you can use formatDate function in your html. Not sure if there is an equivalent in Dutch but I knew it's working for English and French.

For the number, ACS is not that custom so the approach is to convert the fields as string befor your delivery.

 

Thanks

David



David Kangni

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

Hi Bjorn,

 

For the date you can use formatDate function in your html. Not sure if there is an equivalent in Dutch but I knew it's working for English and French.

For the number, ACS is not that custom so the approach is to convert the fields as string befor your delivery.

 

Thanks

David



David Kangni

Avatar

Level 3
Hey David, do you have on docs on how it works french?

Avatar

Community Advisor

See there. https://docs.adobe.com/content/help/en/campaign-classic/technicalresources/api/f-formatDate.html

Also keep in mind that it will display the language in which your ACS instance was installed. Basically if your ACS install language is in English the format date will return in English

Thanks,

David



David Kangni

Avatar

Level 2

Hi,

Does anybody have an example how to change the date format in HTML?

Kind regards,

Björn

Avatar

Community Advisor
you can use <%= formatDate(new Date(), "%4Y%2M%2D%2H%2N%2S") %>. replace newDate() by your date field


David Kangni

Avatar

Level 2

Hi @DavidKangni, thank you for your answer and example code.

Where in the HTML do I have to add your code? 

<span class="acr-field nl-dce-field" data-nl-expr="/context/targetData/datum" data-nl-type="date" contenteditable="false">datum (datum)</span>

Thank you in advance!