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) {
145
145
const deadlineEnd = moment ( nextPhase && phaseEndDate ( nextPhase ) ) ;
146
146
const currentTime = moment ( ) ;
147
147
148
- const timeDiff = getTimeLeft ( currentPhases , 'to go' ) ;
148
+ const timeDiff = getTimeLeft ( currentPhases , 'to go' , true ) ;
149
149
150
150
if ( ! timeDiff . late ) {
151
151
timeDiff . text = timeDiff . text . replace ( 'to go' , '' ) ;
@@ -447,7 +447,7 @@ export default function ChallengeHeader(props) {
447
447
( status || '' ) . toLowerCase ( ) === 'active'
448
448
&& (
449
449
< div styleName = "current-phase" >
450
- { currentPhases && `${ currentPhases . name } Ends: ` }
450
+ { currentPhases && `${ currentPhases . name } Ends In : ` }
451
451
< span styleName = "deadline-highlighted" >
452
452
{ timeDiff . text }
453
453
</ span >
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export function getEndDate(challenge) {
55
55
export function getTimeLeft (
56
56
phase ,
57
57
toGoText = 'to go' ,
58
+ fullText = false ,
58
59
) {
59
60
const STALLED_TIME_LEFT_MSG = 'Challenge is currently on hold' ;
60
61
const FF_TIME_LEFT_MSG = 'Winner is working on fixes' ;
@@ -71,9 +72,9 @@ export function getTimeLeft(
71
72
if ( late ) time = - time ;
72
73
73
74
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]' ;
77
78
78
79
time = moment . duration ( time ) . format ( format ) ;
79
80
time = late ? `${ time } Past Due` : `${ time } ${ toGoText } ` ;
You can’t perform that action at this time.
0 commit comments