File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/shared/components/SubmissionManagement/SubmissionManagement Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,13 @@ export default function SubmissionManagement(props) {
45
45
46
46
const isDesign = challengeType === 'design' ;
47
47
const isDevelop = challengeType === 'develop' ;
48
- const currentPhase = _ . find ( challenge . phases || [ ] , { isOpen : true } ) ;
48
+ const currentPhase = challenge . phases
49
+ . filter ( p => p . name !== 'Registration' && p . isOpen )
50
+ . sort ( ( a , b ) => moment ( a . scheduledEndDate ) . diff ( b . scheduledEndDate ) ) [ 0 ] ;
49
51
50
52
const now = moment ( ) ;
51
53
const end = moment ( currentPhase . scheduledEndDate ) ;
52
- const diff = end . diff ( now ) ;
54
+ const diff = end . isAfter ( now ) ? end . diff ( now ) : 0 ;
53
55
const timeLeft = moment . duration ( diff ) ;
54
56
55
57
const [ days , hours , minutes ] = [
You can’t perform that action at this time.
0 commit comments