Working with Dates
There are a number of different ways to output Dates with handlebars.
Dates can be formatted to whatever way you need them output by using the dateFormat Helper.
The built-in dateElement Helper allows you to get the Date from a Date element to pass to the dateFormat Helper.
Here are some examples of the dateFormat Helper in action:
Without dateFormat
{{publish element="Date element"}}
With dateFormat (using a Date element)
In this example we use the dateElement Helper to allow us to format dates returned from a Date content element
{{dateFormat (dateElement element="Date element") }}
With dateFormat (using contentLastModifiedDate)
In this example we use the dateElement Helper to allow us to format dates returned from the contentLastModifiedDate Helper.
{{dateFormat (contentLastModifiedDate) }}
With dateFormat value "full"
{{dateFormat (dateElement element="Date element") "full" }}
With dateFormat value "long"
{{dateFormat (dateElement element="Date element") "long" }}
With dateFormat value "medium"
{{dateFormat (dateElement element="Date element") "medium" }}
With dateFormat value "short"
{{dateFormat (dateElement element="Date element") "short" }}
With dateFormat value "long" and timeFormat value "full"
{{dateFormat (dateElement element="Date element") "long" time="full" }}
With dateFormat value "long" and timeFormat value "long"
{{dateFormat (dateElement element="Date element") "long" time="long" }}
With dateFormat value "long" and timeFormat value "medium"
{{dateFormat (dateElement element="Date element") "long" time="medium" }}
With dateFormat value "long" and timeFormat value "short"
{{dateFormat (dateElement element="Date element") "long" time="short" }}
With dateFormat value "YYYY/MM/dd hh:mma"
{{dateFormat (dateElement element="Date element") "YYYY/MM/dd hh:mma" }}