Formatting (#datetime, text case, #trim)
Dates: #datetime
Section titled “Dates: #datetime”#datetime formats a date. On its own it outputs today’s date; give it a date field to format that field:
Today is {{#datetime}}.Completion is due on {{#datetime keydates.completion}}.By default dates are shown as d mmmm yyyy (e.g. 2 January 2025). To choose your own format, add a format in single quotes:
{{#datetime keydates.completion 'dd/mm/yyyy'}}{{#datetime $now 'dddd d mmmm yyyy'}}If keydates.completion is 2 January 2025, the first line outputs 02/01/2025 and the second outputs Thursday 2 January 2025.
Format tokens
Section titled “Format tokens”| Token | Meaning | Example |
|---|---|---|
yyyy | 4-digit year | 2025 |
yy | 2-digit year | 25 |
mmmm | Month name | January |
mmm | Short month | Jan |
mm | 2-digit month | 01 |
m | Month number | 1 |
dddd | Day name | Thursday |
ddd | Short day | Thu |
dd | 2-digit day | 02 |
d | Day number | 2 |
do | Day with ordinal | 2nd |
hh:mm | Time | 03:04 |
a | am/pm | am |
To include literal words in a format, wrap them in square brackets, e.g. '[Completion:] d mmmm yyyy'.
Changing text case
Section titled “Changing text case”| Helper | Effect | Example |
|---|---|---|
#uppercase | ALL CAPS | {{#uppercase stakeholder.client.1.surname}} |
#lowercase | all lower case | {{#lowercase stakeholder.client.1.email}} |
#titlecase | Capitalises Each Word | {{#titlecase stakeholder.client.1.fullname}} |
Each takes a single data marker or variable.
Removing spaces: #trim
Section titled “Removing spaces: #trim”#trim removes spaces from the start and end of a value:
{{#trim stakeholder.client.1.forename}}