@@ -185,13 +185,13 @@ class ChallengePhaseHelper {
185
185
} ;
186
186
if ( _ . isUndefined ( phase . predecessor ) ) {
187
187
if ( _ . isUndefined ( _ . get ( phaseFromInput , "scheduledStartDate" ) ) ) {
188
- phase . scheduledStartDate = moment ( startDate ) . toDate ( ) ;
188
+ phase . scheduledStartDate = moment ( startDate ) . toDate ( ) . toISOString ( ) ;
189
189
} else {
190
- phase . scheduledStartDate = moment ( _ . get ( phaseFromInput , "scheduledStartDate" ) ) . toDate ( ) ;
190
+ phase . scheduledStartDate = moment ( _ . get ( phaseFromInput , "scheduledStartDate" ) ) . toDate ( ) . toISOString ( ) ;
191
191
}
192
192
phase . scheduledEndDate = moment ( phase . scheduledStartDate )
193
193
. add ( phase . duration , "seconds" )
194
- . toDate ( ) ;
194
+ . toDate ( ) . toISOString ( ) ;
195
195
}
196
196
return phase ;
197
197
} ) ;
@@ -209,7 +209,7 @@ class ChallengePhaseHelper {
209
209
}
210
210
phase . scheduledEndDate = moment ( phase . scheduledStartDate )
211
211
. add ( phase . duration , "seconds" )
212
- . toDate ( ) ;
212
+ . toDate ( ) . toISOString ( ) ;
213
213
}
214
214
return finalPhases ;
215
215
}
@@ -236,36 +236,36 @@ class ChallengePhaseHelper {
236
236
if ( ! _ . isUndefined ( phase . actualEndDate ) ) {
237
237
return updatedPhase ;
238
238
}
239
- if ( phase . name === "Iterative Review Phase" ) {
239
+ if ( updatedPhase . name === "Iterative Review Phase" ) {
240
240
return updatedPhase ;
241
241
}
242
- const newPhase = _ . find ( newPhases , ( p ) => p . phaseId === phase . phaseId ) ;
242
+ const newPhase = _ . find ( newPhases , ( p ) => p . phaseId === updatedPhase . phaseId ) ;
243
243
if ( _ . isUndefined ( newPhase ) && ! isBeingActivated ) {
244
244
return updatedPhase ;
245
245
}
246
- phase . duration = _ . defaultTo ( _ . get ( newPhase , "duration" ) , phase . duration ) ;
247
- if ( _ . isUndefined ( phase . predecessor ) ) {
246
+ updatedPhase . duration = _ . defaultTo ( _ . get ( newPhase , "duration" ) , updatedPhase . duration ) ;
247
+ if ( _ . isUndefined ( updatedPhase . predecessor ) ) {
248
248
if (
249
249
isBeingActivated &&
250
250
moment (
251
- _ . defaultTo ( _ . get ( newPhase , "scheduledStartDate" ) , phase . scheduledStartDate )
251
+ _ . defaultTo ( _ . get ( newPhase , "scheduledStartDate" ) , updatedPhase . scheduledStartDate )
252
252
) . isSameOrBefore ( moment ( ) )
253
253
) {
254
- phase . isOpen = true ;
255
- phase . scheduledStartDate = moment ( ) . toDate ( ) ;
256
- phase . actualStartDate = phase . scheduledStartDate ;
254
+ updatedPhase . isOpen = true ;
255
+ updatedPhase . scheduledStartDate = moment ( ) . toDate ( ) . toISOString ( ) ;
256
+ updatedPhase . actualStartDate = updatedPhase . scheduledStartDate ;
257
257
} else if (
258
- phase . isOpen === false &&
258
+ updatedPhase . isOpen === false &&
259
259
! _ . isUndefined ( _ . get ( newPhase , "scheduledStartDate" ) )
260
260
) {
261
- phase . scheduledStartDate = moment ( newPhase . scheduledStartDate ) . toDate ( ) ;
261
+ updatedPhase . scheduledStartDate = moment ( newPhase . scheduledStartDate ) . toDate ( ) . toISOString ( ) ;
262
262
}
263
- phase . scheduledEndDate = moment ( phase . scheduledStartDate )
264
- . add ( phase . duration , "seconds" )
265
- . toDate ( ) ;
263
+ updatedPhase . scheduledEndDate = moment ( updatedPhase . scheduledStartDate )
264
+ . add ( updatedPhase . duration , "seconds" )
265
+ . toDate ( ) . toISOString ( ) ;
266
266
}
267
267
if ( ! _ . isUndefined ( newPhase ) && ! _ . isUndefined ( newPhase . constraints ) ) {
268
- phase . constraints = newPhase . constraints ;
268
+ updatedPhase . constraints = newPhase . constraints ;
269
269
}
270
270
return updatedPhase ;
271
271
} ) ;
@@ -282,7 +282,7 @@ class ChallengePhaseHelper {
282
282
phase . scheduledStartDate = precedecessorPhase . scheduledEndDate ;
283
283
phase . scheduledEndDate = moment ( phase . scheduledStartDate )
284
284
. add ( phase . duration , "seconds" )
285
- . toDate ( ) ;
285
+ . toDate ( ) . toISOString ( ) ;
286
286
}
287
287
return updatedPhases ;
288
288
}
0 commit comments