File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,14 @@ function filterByStarted(challenge, state) {
130
130
return moment ( challenge . registrationStartDate ) . isBefore ( Date . now ( ) ) ;
131
131
}
132
132
133
+ function filterByOngoing ( challenge , state ) {
134
+ if ( _ . isUndefined ( state . ongoing ) ) return true ;
135
+ const registrationPhase = ( challenge . phases || [ ] ) . filter ( d => d . name === 'Registration' ) [ 0 ] ;
136
+ const registrationEndDate = registrationPhase ? registrationPhase . scheduledEndDate
137
+ : challenge . registrationEndDate ;
138
+ return moment ( registrationEndDate ) . isBefore ( Date . now ( ) ) ;
139
+ }
140
+
133
141
function filterByStatus ( challenge , state ) {
134
142
if ( ! state . status ) return true ;
135
143
return state . status . includes ( challenge . status ) ;
@@ -219,6 +227,7 @@ export function getFilterFunction(state) {
219
227
&& filterByEndDate ( challenge , state )
220
228
&& filterByStartDate ( challenge , state )
221
229
&& filterByStarted ( challenge , state )
230
+ && filterByOngoing ( challenge , state )
222
231
&& filterByRegistrationOpen ( challenge , state ) ;
223
232
if ( ! test && state . or ) {
224
233
let pos = 0 ;
You can’t perform that action at this time.
0 commit comments