From 1a20f82e4cf1fdcbf4bb34a910823536d4574e5f Mon Sep 17 00:00:00 2001 From: anbr Date: Sun, 15 Apr 2012 16:52:17 +0200 Subject: jason, if the recording is greater than 24 hours a wrong time is displayed (Closes: #938) --- skins/jason/recordings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/skins/jason/recordings.js b/skins/jason/recordings.js index cc1faeb..7ac303f 100644 --- a/skins/jason/recordings.js +++ b/skins/jason/recordings.js @@ -12,8 +12,15 @@ minTime = function() { Ext.form.TimeField.prototype.initDateFormat).clearTime(); }; +pad = function(n) { + return String("00" + parseInt(n)).slice(-2); +}; + SecondsToHMS = function(t) { - return new Date(minTime().getTime()+(t * 1000)).dateFormat('H:i:s'); + var s = t % 60; + var m = parseInt(t / 60) % 60; + var h = parseInt(t / 3600); + return h + ":" + pad(m) + ":" + pad(s); }; /******************************************************************************/ -- cgit v1.2.3