File tree Expand file tree Collapse file tree 4 files changed +6
-27
lines changed Expand file tree Collapse file tree 4 files changed +6
-27
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import Container from 'components/Container';
16
16
import Header from 'components/Header' ;
17
17
import React from 'react' ;
18
18
import { sharedStyles } from 'theme' ;
19
- import dateToString from 'utils/dateToString' ;
20
19
import toCommaSeparatedList from 'utils/toCommaSeparatedList' ;
21
20
22
21
const AllBlogPosts = ( { data} ) => (
@@ -38,7 +37,7 @@ const AllBlogPosts = ({data}) => (
38
37
{ ' ' }
39
38
on
40
39
{ ' ' }
41
- { dateToString ( new Date ( node . fields . date ) ) }
40
+ { node . fields . date }
42
41
{ ' ' }
43
42
by
44
43
{ ' ' }
@@ -72,7 +71,7 @@ export const pageQuery = graphql`
72
71
}
73
72
}
74
73
fields {
75
- date
74
+ date(formatString: "MMMM DD, YYYY")
76
75
slug
77
76
}
78
77
}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const toSectionList = allMarkdownRemark => [
34
34
const Blog = ( { data, location} ) => (
35
35
< MarkdownPage
36
36
authors = { data . markdownRemark . frontmatter . author }
37
- date = { new Date ( data . markdownRemark . fields . date ) }
37
+ date = { data . markdownRemark . fields . date }
38
38
location = { location }
39
39
markdownRemark = { data . markdownRemark }
40
40
sectionList = { toSectionList ( data . allMarkdownRemark ) }
@@ -62,7 +62,7 @@ export const pageQuery = graphql`
62
62
}
63
63
}
64
64
fields {
65
- date
65
+ date(formatString: "MMMM DD, YYYY")
66
66
path
67
67
}
68
68
}
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import {StickyContainer} from 'react-sticky';
19
19
import PropTypes from 'prop-types' ;
20
20
import React from 'react' ;
21
21
import StickySidebar from '../StickySidebar' ;
22
- import dateToString from 'utils/dateToString' ;
23
22
import findSectionForPath from 'utils/findSectionForPath' ;
24
23
import toCommaSeparatedList from 'utils/toCommaSeparatedList' ;
25
24
import { sharedStyles } from 'theme' ;
@@ -62,7 +61,7 @@ const MarkdownPage = ({
62
61
63
62
{ ( date || hasAuthors ) &&
64
63
< div css = { { marginTop : 15 } } >
65
- { date ? ` ${ dateToString ( date ) } ` : ' '}
64
+ { date } { ' '}
66
65
{ hasAuthors &&
67
66
< span >
68
67
by { toCommaSeparatedList ( authors , author => (
@@ -122,7 +121,7 @@ MarkdownPage.defaultProps = {
122
121
// TODO Better types
123
122
MarkdownPage . propTypes = {
124
123
authors : PropTypes . array . isRequired ,
125
- date : PropTypes . object ,
124
+ date : PropTypes . string ,
126
125
location : PropTypes . object . isRequired ,
127
126
markdownRemark : PropTypes . object . isRequired ,
128
127
sectionList : PropTypes . array . isRequired ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments