Skip to content

Commit 0ec4511

Browse files
authored
feat: use strict ISO 8601 for the date (CollierCZ#186)
Format the date value with strict ISO 8601 instead of git's ISO 8601-like format to get any standard compliant to parse it.
1 parent fb36168 commit 0ec4511

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/__tests__/gatsby_node.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe(`Processing File nodes matching filter regex`, () => {
138138
expect(createNodeField).toHaveBeenCalledWith({
139139
node,
140140
name: `gitLogLatestDate`,
141-
value: `2018-08-20 20:19:19 +0000`,
141+
value: `2018-08-20T20:19:19+00:00`,
142142
});
143143
});
144144

@@ -161,7 +161,7 @@ describe(`Processing File nodes matching filter regex`, () => {
161161
expect(createNodeField).toHaveBeenCalledWith({
162162
node,
163163
name: `gitLogLatestDate`,
164-
value: `2018-08-20 21:19:19 +0000`,
164+
value: `2018-08-20T21:19:19+00:00`,
165165
});
166166
});
167167

@@ -184,7 +184,7 @@ describe(`Processing File nodes matching filter regex`, () => {
184184
expect(createNodeField).toHaveBeenCalledWith({
185185
node,
186186
name: `gitLogLatestDate`,
187-
value: `2018-08-20 21:19:19 +0000`,
187+
value: `2018-08-20T21:19:19+00:00`,
188188
});
189189
});
190190

src/gatsby-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function getLogWithRetry(gitRepo, node, retry = 2) {
2222
file: filePath,
2323
n: 1,
2424
format: {
25-
date: `%ai`,
25+
date: `%aI`,
2626
authorName: `%an`,
2727
authorEmail: "%ae",
2828
},

0 commit comments

Comments
 (0)