We needed a specific way to display the task due date in a macro:
{ticket.due_date_with_timestamp}
We noticed that with the above it would insert the date like so:
2015-12-31T12:00:00Z
However we wanted to display it like this:
31st December 2015
There was no instructions on how to format it where it would apply the appropriate end of the day "th" "st" "nd" "rd".
To achieve this you will need to simply copy and paste the following in your macro:
{% assign d = ticket.due_date_with_timestamp | date: "%-d" %} {% case d %}{% when "1" or "21" or "31" %}{{ d }}st{% when "2" or "22" %}{{ d }}nd{% when "3" or "23" %}{{ d }}rd{% else %}{{ d }}th{% endcase %} {{ticket.due_date_with_timestamp | date: "%B"}} {{ticket.due_date_with_timestamp | date: "%Y"}}
I hope this helps somebody as it did for us!
All the best,
Ben
ParcelBroker.co.uk