diff --git a/src/components/releases.js b/src/components/releases.js index 47afbf946d..d1d27d5e07 100644 --- a/src/components/releases.js +++ b/src/components/releases.js @@ -15,13 +15,12 @@ const shortcodes = { const Releases = ({ data }) => { const oneYearAgo = subYears(new Date(), 1); - // Filter releases that are newer than one year + // Filter releases published within the last year const filteredReleases = data.allTerminusReleasesJson.edges.filter( - (release) => - isAfter( - parseISO(release.node.fields.markdownBody.childMdx.body.published_at), - oneYearAgo, - ), + (release) => { + const publishedDate = release.node.published_at; + return publishedDate && isAfter(parseISO(publishedDate), oneYearAgo); + } ); return ( @@ -32,9 +31,7 @@ const Releases = ({ data }) => { {release.node.tag_name} - - {release.node.fields.markdownBody.childMdx.body} - + {release.node.fields.markdownBody.childMdx.body}
@@ -52,6 +49,7 @@ export default (props) => ( node { id tag_name + published_at fields { markdownBody { childMdx {