File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export default function ChallengeHeader(props) {
145145 const deadlineEnd = moment ( nextPhase && phaseEndDate ( nextPhase ) ) ;
146146 const currentTime = moment ( ) ;
147147
148- const timeDiff = getTimeLeft ( currentPhases , 'to go' ) ;
148+ const timeDiff = getTimeLeft ( currentPhases , 'to go' , true ) ;
149149
150150 if ( ! timeDiff . late ) {
151151 timeDiff . text = timeDiff . text . replace ( 'to go' , '' ) ;
@@ -447,7 +447,7 @@ export default function ChallengeHeader(props) {
447447 ( status || '' ) . toLowerCase ( ) === 'active'
448448 && (
449449 < div styleName = "current-phase" >
450- { currentPhases && `${ currentPhases . name } Ends: ` }
450+ { currentPhases && `${ currentPhases . name } Ends In : ` }
451451 < span styleName = "deadline-highlighted" >
452452 { timeDiff . text }
453453 </ span >
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export function getEndDate(challenge) {
5555export function getTimeLeft (
5656 phase ,
5757 toGoText = 'to go' ,
58+ fullText = false ,
5859) {
5960 const STALLED_TIME_LEFT_MSG = 'Challenge is currently on hold' ;
6061 const FF_TIME_LEFT_MSG = 'Winner is working on fixes' ;
@@ -71,9 +72,9 @@ export function getTimeLeft(
7172 if ( late ) time = - time ;
7273
7374 let format ;
74- if ( time > DAY_MS ) format = 'D[d] H[h]' ;
75- else if ( time > HOUR_MS ) format = 'H[h] m[min]' ;
76- else format = 'm[min] s[s]' ;
75+ if ( time > DAY_MS ) format = fullText ? 'D [day] H [hour]' : 'D[d] H[h]' ;
76+ else if ( time > HOUR_MS ) format = fullText ? 'H [hour] m [minute]' : 'H[h] m[min]' ;
77+ else format = fullText ? 'm [minute] s [second]' : 'm[min] s[s]' ;
7778
7879 time = moment . duration ( time ) . format ( format ) ;
7980 time = late ? `${ time } Past Due` : `${ time } ${ toGoText } ` ;
You can’t perform that action at this time.
0 commit comments