Skip to content

Commit f444233

Browse files
committed
Updated wording on time remaining in phase
#6815
1 parent 3ee73d2 commit f444233

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/shared/components/challenge-detail/Header/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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>

src/shared/utils/challenge-detail/helper.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function getEndDate(challenge) {
5555
export 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}`;

0 commit comments

Comments
 (0)