Usage: {{date value format="formatString"}}
Description
{{date}} is a formatting helper for outputting dates in various format. You can either pass it a date and a format string to be used to output the date like so:
// outputs something like 'July 11, 2016'
Or you can pass it a date and the timeago flag:
// outputs something like '5 mins ago'
If you call {{date}} without a format, it will default to “MMM Do, YYYY”.
If you call {{date}} without telling it which date to display, it will default to one of two things:
- If there is a
published_atproperty available (i.e. you're inside a post object) it will use that - Otherwise, it will default to the current date
date uses moment.js for formatting dates. See their documentation for a full explanation of all the different format strings that can be used.
Example Code
<main role="main">
<h2><a href=""></a></h2>
<p></p>
<time datetime=""></time>
</main>
<footer>
<p class="small">© </p>
</footer>