Date Templating

The Date field allows content writers to add a date that represents a calendar day.

Usage

Here’s an example of how to integrate a Date field into your template.

  • ejs
  • pug
  • pug (API v1)
Copy
<span class="date">
  <%= PrismicDOM.Date(document.data.postDate) %>
</span>
Copy
span.date !{ PrismicDOM.Date(document.data.postDate) }
Copy
span.date !{ document.getDate('post.date').toDateString() }