Mandrill Handlebars Template Date Formatting

472 views Asked by At

So, I'm working on a template where I have a merge variable, dateSubmitted. This variable comes from an API where it's formatted as so:

dateSubmitted = 2017-09-13GMT22:25:45.513+00:00

I'm trying to insert this date in a slightly nicer way into an email, so in my Mandrill template (using Handlebars) I'm doing the following:

<li><em>Date Submitted:</em> {{date dateSubmitted}}</li>

However, my date continues to display in the email as 2017-09-13GMT22:25:45.513+00:00. What am I doing wrong?

1

There are 1 answers

2
v01d On

Stumble upon this too. After an hour I re-read the docs, where is stated, that this inline helper is used to

print the current date with a given format, defaults to d/m/Y

So, it is not for formatting your variables but for just displaying current date in custom format.