Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
fix: date-fns imports (new version)
Browse files Browse the repository at this point in the history
  • Loading branch information
CanRau committed Aug 26, 2019
1 parent 3d22d8a commit 8665d53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gatsby/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { compareAsc, parse: parseDate } = require(`date-fns`)
const { compareAsc, parseISO } = require(`date-fns`)
const R = require(`ramda`)
const { shuffle } = require(`lodash`)
const speakingUrl = require(`speakingurl`)
Expand Down Expand Up @@ -42,7 +42,7 @@ const sortTuplesByDateAndLayout = R.sort((a, b) => {
const _b = b[0].frontmatter
// either both layouts are equal in our case both equal BlogPost or none of them equals BlogPost
return _a.layout === _b.layout || [_a, _b].every(x => x.layout !== `BlogPost`)
? compareAsc(parseDate(_a.date), parseDate(_b.date))
? compareAsc(parseISO(_a.date), parseISO(_b.date))
: _a.layout === `BlogPost`
? 1
: -1
Expand Down

0 comments on commit 8665d53

Please sign in to comment.