Skip to content

Commit 39fa0e9

Browse files
authored
Merge pull request #965 from tech-conferences/showCFPincludingToday
showCFP should also include cfps which end today
2 parents 4aeeda7 + be86764 commit 39fa0e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/scenes/ConferenceList/components/ConferenceList/ConferenceList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isPast, parseISO } from 'date-fns'
1+
import { isFuture, isToday, parseISO } from 'date-fns'
22
import { filter } from 'lodash'
33
import React from 'react'
44
import { connectInfiniteHits } from 'react-instantsearch-dom'
@@ -36,7 +36,9 @@ const ConferenceList: React.FC<Props> = ({
3636

3737
if (showCFP) {
3838
filteredConferences = filter(hits, (conf) => {
39-
return conf.cfpEndDate && !isPast(parseISO(conf.cfpEndDate))
39+
if (!conf.cfpEndDate) return false
40+
const cfpEndDate = parseISO(conf.cfpEndDate)
41+
return isToday(cfpEndDate) || isFuture(cfpEndDate)
4042
}) as Conference[]
4143
}
4244
const confs = groupAndSortConferences(

0 commit comments

Comments
 (0)