Thank you for your reply Sam.
My date field JSON looks like this, I believe this is just a "date" field and not the metadata.
"title" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1",
"label" : "Title",
"placeholder" : "Blog Post Title..."
}
},
"date" : {
"type" : "Date",
"config" : {
"label" : "Date"
}
},
The data is rendered with this component:
import React from 'react'
import { Date } from 'prismic-reactjs'
/**
- Post list item date component
*/
const PostDate = ({ date }) => {
// Format the date to M d, Y
const dateFormat = {
month: 'short',
day: '2-digit',
year: 'numeric'
}
const displayDate = new Intl.DateTimeFormat('en-US', dateFormat).format(Date(date))
return (
{displayDate}
)
}
export default PostDate