Skip to content

Instantly share code, notes, and snippets.

@DSchau
Created September 9, 2017 20:27
Show Gist options
  • Save DSchau/86ee9288b05d236dada81148f66db8db to your computer and use it in GitHub Desktop.
Save DSchau/86ee9288b05d236dada81148f66db8db to your computer and use it in GitHub Desktop.
The GraphQL query showing how to format a date!
export const pageQuery = graphql`
query IndexQuery {
site {
siteMetadata {
title
author
}
}
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {
edges {
node {
excerpt(pruneLength: 250)
id
frontmatter {
date(formatString: "MMMM DD, YYYY")
draft
excerpt
path
tags
title
}
}
}
}
}
`
@donjude-eng
Copy link

Thank you for this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment