Skip to content

Commit 65ecff9

Browse files
committed
Fix seconds and minutes add 0 digit when values are single digits;
1 parent 81a675d commit 65ecff9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export default class CountdownTimer extends Component {
9999
let hours = Math.floor(time / 3600) % 24;
100100
let day = Math.floor(time / 86400);
101101
day = day.toString().length === 1 ? `0${day}` : day;
102-
minutes = Number.parseInt(minutes.toString().length === 1 ? "0".concat(minutes) : minutes);
103-
seconds = Number.parseInt(seconds.toString().length === 1 ? "0".concat(seconds) : seconds);
102+
minutes = minutes.toString().length === 1 ? `0${minutes}` : minutes;
103+
seconds = seconds.toString().length === 1 ? `0${seconds}` : seconds;
104104
hours = hours.toString().length === 1 ? `0${hours}` : hours;
105105
if (showTitle) {
106106
const borderClass = border ? 'border' : '';

0 commit comments

Comments
 (0)