From 97ed3f6a1c4c636904a1bd33b1d931d8c12bb0d9 Mon Sep 17 00:00:00 2001 From: sr_jr Date: Mon, 25 May 2020 23:25:28 +0530 Subject: [PATCH] fix for issue #4409 --- src/utils/challenge/filter.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/utils/challenge/filter.js b/src/utils/challenge/filter.js index 30fe6210..92659205 100644 --- a/src/utils/challenge/filter.js +++ b/src/utils/challenge/filter.js @@ -111,20 +111,18 @@ function filterByReviewOpportunityType(opp, state) { function filterByStartDate(challenge, state) { if (!state.startDate) return true; - const submissionPhase = challenge.phases.filter(d => d.name === 'Submission')[0]; - if (submissionPhase) { - return moment(state.startDate).isBefore(submissionPhase.scheduledEndDate); - } - return false; + const submissionPhase = (challenge.phases || []).filter(d => d.name === 'Submission')[0]; + const submissionEndDate = submissionPhase ? submissionPhase.scheduledEndDate + : challenge.submissionEndDate; + return moment(state.startDate).isBefore(submissionEndDate); } function filterByEndDate(challenge, state) { if (!state.endDate) return true; - const registrationPhase = challenge.phases.filter(d => d.name === 'Registration')[0]; - if (registrationPhase) { - return moment(state.endDate).isAfter(registrationPhase.scheduledStartDate); - } - return false; + const registrationPhase = (challenge.phases || []).filter(d => d.name === 'Registration')[0]; + const registrationStartDate = registrationPhase ? registrationPhase.scheduledStartDate + : challenge.registrationStartDate; + return moment(state.endDate).isAfter(registrationStartDate); } function filterByStarted(challenge, state) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy