File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -111,20 +111,18 @@ function filterByReviewOpportunityType(opp, state) {
111
111
112
112
function filterByStartDate ( challenge , state ) {
113
113
if ( ! state . startDate ) return true ;
114
- const submissionPhase = challenge . phases . filter ( d => d . name === 'Submission' ) [ 0 ] ;
115
- if ( submissionPhase ) {
116
- return moment ( state . startDate ) . isBefore ( submissionPhase . scheduledEndDate ) ;
117
- }
118
- return false ;
114
+ const submissionPhase = ( challenge . phases || [ ] ) . filter ( d => d . name === 'Submission' ) [ 0 ] ;
115
+ const submissionEndDate = submissionPhase ? submissionPhase . scheduledEndDate
116
+ : challenge . submissionEndDate ;
117
+ return moment ( state . startDate ) . isBefore ( submissionEndDate ) ;
119
118
}
120
119
121
120
function filterByEndDate ( challenge , state ) {
122
121
if ( ! state . endDate ) return true ;
123
- const registrationPhase = challenge . phases . filter ( d => d . name === 'Registration' ) [ 0 ] ;
124
- if ( registrationPhase ) {
125
- return moment ( state . endDate ) . isAfter ( registrationPhase . scheduledStartDate ) ;
126
- }
127
- return false ;
122
+ const registrationPhase = ( challenge . phases || [ ] ) . filter ( d => d . name === 'Registration' ) [ 0 ] ;
123
+ const registrationStartDate = registrationPhase ? registrationPhase . scheduledStartDate
124
+ : challenge . registrationStartDate ;
125
+ return moment ( state . endDate ) . isAfter ( registrationStartDate ) ;
128
126
}
129
127
130
128
function filterByStarted ( challenge , state ) {
You can’t perform that action at this time.
0 commit comments