Skip to content

Commit 9879dbe

Browse files
authored
Merge pull request #31 from hidde/patch-1
Count today's meetup as future, not past
2 parents 252cb31 + 2658856 commit 9879dbe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Layout from '../containers/layout'
44
import Panel, { LargeParagraph } from '../components/Panel'
55
import City, { Cities } from '../components/City'
66

7-
import { isFuture, parse } from 'date-fns'
7+
import { isFuture, isToday, parse } from 'date-fns'
88
import { graphql } from 'gatsby'
99

1010
const IndexPage = ({ data: { allEvent } }) => {
@@ -13,8 +13,12 @@ const IndexPage = ({ data: { allEvent } }) => {
1313
(a, b) => getDate(a.node.info.date) - getDate(b.node.info.date)
1414
)
1515

16-
const futureMeetups = sortedCities.filter(city => isFuture(city.node.info.date))
17-
const pastMeetups = sortedCities.filter(city => !isFuture(city.node.info.date))
16+
const futureMeetups = sortedCities.filter(
17+
city => isFuture(city.node.info.date) || isToday(city.node.info.date)
18+
)
19+
const pastMeetups = sortedCities.filter(
20+
city => !isFuture(city.node.info.date) && !isToday(city.node.info.date)
21+
)
1822

1923
return (
2024
<Layout>

0 commit comments

Comments
 (0)