From 02d172508aa0e213bb79f70b7d17557a745c55ed Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 29 Aug 2014 08:43:21 -0700 Subject: [PATCH] Zero-pad minutes --- static/js/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 412350c..47e9685 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -168,9 +168,9 @@ var behaviors = { }).on("slide", function(){ newTime = $(".time-holder .player-slider").slider('getValue').val(); hours = Math.floor(newTime/60/60) - minutes = Math.floor(newTime/60)%60 + minutes = Math.floor(newTime/60) seconds = Math.floor(newTime-(minutes*60)) - $(".timeshow").html((hours>0?hours+":":"")+minutes+":"+(seconds<10?"0":"")+seconds) + $(".timeshow").html((hours>0?hours+":":"")+(minutes%60<10?"0":"")+minutes%60+":"+(seconds<10?"0":"")+seconds) }); }, play:function() { @@ -186,9 +186,9 @@ var behaviors = { // And update the time newTime = event.jPlayer.status.currentTime; hours = Math.floor(newTime/60/60) - minutes = Math.floor(newTime/60)%60 + minutes = Math.floor(newTime/60) seconds = Math.floor(newTime-(minutes*60)) - $(".timeshow").html((hours>0?hours+":":"")+minutes+":"+(seconds<10?"0":"")+seconds) + $(".timeshow").html((hours>0?hours+":":"")+(minutes%60<10?"0":"")+minutes%60+":"+(seconds<10?"0":"")+seconds) } })