Feature Request: Different ways of showing date in email
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › Modern DFFS › Feature Request: Different ways of showing date in email
Is there a way to show date in email from current record in different formats? I am mostly interested in showing just the date. When I use the Date as string option, it shows up as the date with time appended to it (even if field is not set to display time). If you are going to have to add something custom to achieve this, then may be have something we can pass in as the display format (this is just a request for future proofing) – something like have the ability to pass in different formats as javascript would allow us to do.
Thank you,
Amal Vellappillil
Hi
I’ll add support for specifying the dateformat when selecting from the “Add dynamic content” menu in the next version, but as a workaround you can add this to your Custom JS (replace DueDate with the actual internal name of your field):
var myCustomDate = ""; // Must use var an not let to make it globally available
function dffs_PreSaveAction() {
const date = getFieldValue("DueDate", "dateObject");
const formatter = new Intl.DateTimeFormat('en-US', { day: '2-digit', month: '2-digit', year: 'numeric' });
myCustomDate = formatter.format(date);
}
Now add this variable to your email body like this:
myCustomDate: [[variable:myCustomDate]]
Alexander
Thank you for the work around and looking forward to an UI implementation to this in the future release.