]> code.delx.au - countdown-timer/commitdiff
Fixed calculation of hours/minutes display
authorJames Bunton <jamesbunton@delx.net.au>
Sat, 16 Feb 2013 23:46:08 +0000 (10:46 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Sat, 16 Feb 2013 23:46:08 +0000 (10:46 +1100)
timer.js

index 4f954abdcdd7feac9f1946c394354cf2894210a6..af00ef8c51bb8e7c902c97f29da52b87cf2f97ec 100644 (file)
--- a/timer.js
+++ b/timer.js
@@ -72,8 +72,8 @@ var fillDisplay = function(s) {
 
 var formatTimeSecs = function(tsec) {
        var seconds = tsec % 60;
-       var minutes = Math.floor(tsec / 60);
-       var hours = Math.floor(theTimeoutEntry / 3600);
+       var minutes = Math.floor(tsec / 60) % 60;
+       var hours = Math.floor(tsec / 3600);
        return formatTimeHMS(seconds, minutes, hours);
 };