Skip to content

Commit

Permalink
fix: format time when timer starts/stops
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-godoy authored and paodb committed Jul 11, 2024
1 parent e30e5fd commit 66d7abf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ Polymer({
ready: function() {
if (this.countUp) {
this.set('currentTime', 0);
this.set('_formattedTime', '0');
} else {
this.set('currentTime', this.startTime);
this.set('_formattedTime', this.startTime.toString());
}
},

Expand Down Expand Up @@ -175,6 +173,9 @@ Polymer({
if (timeString[0].indexOf('-') === 0) {
return 0;
}
if (timeString.length==1) {
timeString.push("00");
}
var seconds = timeString[0];
var minutes = seconds / 60 | 0;
var hours = minutes / 60 | 0;
Expand Down

0 comments on commit 66d7abf

Please sign in to comment.