This commit is contained in:
Travis Fischer
2022-04-08 09:07:25 -04:00
parent 89b3c8faba
commit 67b5a8d58c
4 changed files with 42 additions and 32 deletions

View File

@@ -75,21 +75,12 @@ export default withOGImage<'query', 'id'>({
// getPageProperty<string>('Description', block, recordMap) ||
// config.description
const timeUpdated = getPageProperty<number>(
'Last Updated',
block,
recordMap
)
const timePublished = getPageProperty<number>(
'Published',
block,
recordMap
)
const dateUpdated = timeUpdated
? new Date(timeUpdated)
: timePublished
? new Date(timePublished)
: undefined
const dateUpdated = timePublished ? new Date(timePublished) : undefined
const date =
isBlogPost && dateUpdated
? `${dateUpdated.toLocaleString('en-US', {