diff --git a/src/graphql-fragments.js b/src/graphql-fragments.js index 1311fb8a..3ff3b0f2 100644 --- a/src/graphql-fragments.js +++ b/src/graphql-fragments.js @@ -71,7 +71,7 @@ export const SharedBetweenPostsAndEventsFragment = graphql` fields { key slug - date(formatString: "MMMM D, YYYY") + date } frontmatter { href diff --git a/src/templates/Event.js b/src/templates/Event.js index 5b926299..7b4d2186 100644 --- a/src/templates/Event.js +++ b/src/templates/Event.js @@ -1,4 +1,5 @@ import {graphql, Link} from 'gatsby'; +import moment from 'moment'; import {track, extract, mapNodeToProps} from '~/utilities'; import Img from 'gatsby-image'; import {Text, Meta, Layout, Nav, Button} from '~/components'; @@ -182,7 +183,7 @@ export default props => {
{title}
- +
diff --git a/src/utilities/groupEventEdges.js b/src/utilities/groupEventEdges.js index e9580af5..b4bbb931 100644 --- a/src/utilities/groupEventEdges.js +++ b/src/utilities/groupEventEdges.js @@ -1,4 +1,5 @@ import {reduce, assoc, invertObj} from 'ramda'; +import moment from 'moment'; import * as extract from './extract'; export const monthNameByIndex = [ @@ -27,5 +28,6 @@ export default reduce((accumulator, current) => { const monthIndex = date.getMonth(); const month = monthNameByIndex[monthIndex]; const key = `${month} ${year}`; + current.node.fields.date = moment(stringifiedDate).format(`MMMM D, YYYY`); return assoc(key, [...(accumulator[key] || []), current], accumulator); }, {});