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

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

  • April 17, 2020
  • 3 replies
  • 8408 views

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.
Best answer by DavidKangni

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

3 replies

DavidKangni
Community Advisor
DavidKangniCommunity AdvisorAccepted solution
Community Advisor
April 18, 2020

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
Level 3
July 20, 2020
Hey David, do you have on docs on how it works french?
Level 2
April 22, 2020

Hi,

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

Kind regards,

Björn

DavidKangni
Community Advisor
Community Advisor
April 24, 2020
you can use <%= formatDate(new Date(), "%4Y%2M%2D%2H%2N%2S") %>. replace newDate() by your date field
David Kangni
Level 2
April 28, 2020

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!