How can I change the date format in an email delivery (field from additional data) | Community
Skip to main content
Level 2
Apr 17, 2020 7:26 AM UTC
Solved

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

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?  

 

 

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
DavidKangni
DavidKangniAccepted solution
New Participant
Apr 18, 2020 12:41 AM UTC

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

6 replies

Level 2
Apr 28, 2020 8:40 AM UTC

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!

Translate
Level 2
Apr 22, 2020 10:10 AM UTC

Hi,

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

Kind regards,

Björn

Translate
DavidKangni
New Participant
Apr 24, 2020 3:23 PM UTC
you can use <%= formatDate(new Date(), "%4Y%2M%2D%2H%2N%2S") %>. replace newDate() by your date field
Translate
David Kangni
DavidKangni
DavidKangniAccepted solution
New Participant
Apr 18, 2020 12:41 AM UTC

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

Translate
David Kangni
Level 3
Jul 20, 2020 9:04 PM UTC
Hey David, do you have on docs on how it works french?
Translate