]> code.delx.au - countdown-timer/blobdiff - timer.js
Fixed calculation of hours/minutes display
[countdown-timer] / 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);
 };