handlebars-helper
handlebars-helper copied to clipboard
ISO8601 formatDate preset
Inserting machine readable datetimes is sometimes needed in templates, i.e. for the <time>
element's datetime
attribute and similar microdata. This can also be useful when scripting. The format of course should be consistent, and ISO8601 is the best choice.
It'd be handy to have a preset for using this format rather than having to specify it by hand, i.e.
{{ formatDate date 'iso8601' }}
vs.
{{ formatDate date '%Y-%m-%dT%H:%M:%S%z' }}