Skip to content

Commit 66d7abf

Browse files
javier-godoypaodb
authored andcommitted
fix: format time when timer starts/stops
1 parent e30e5fd commit 66d7abf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/resources/META-INF/frontend/simple-timer/simple-timer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ Polymer({
121121
ready: function() {
122122
if (this.countUp) {
123123
this.set('currentTime', 0);
124-
this.set('_formattedTime', '0');
125124
} else {
126125
this.set('currentTime', this.startTime);
127-
this.set('_formattedTime', this.startTime.toString());
128126
}
129127
},
130128

@@ -175,6 +173,9 @@ Polymer({
175173
if (timeString[0].indexOf('-') === 0) {
176174
return 0;
177175
}
176+
if (timeString.length==1) {
177+
timeString.push("00");
178+
}
178179
var seconds = timeString[0];
179180
var minutes = seconds / 60 | 0;
180181
var hours = minutes / 60 | 0;

0 commit comments

Comments
 (0)