diff --git a/code/utils_misc.js b/code/utils_misc.js index 331b3ce5..4028db7c 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -81,7 +81,9 @@ window.unixTimeToString = function(time, full) { window.unixTimeToHHmm = function(time) { if(!time) return null; var d = new Date(typeof time === 'string' ? parseInt(time) : time); - return d.getHours() + ':' + d.getSeconds(); + var h = '' + d.getHours(); h = h.length === 1 ? '0' + h : h; + var s = '' + d.getSeconds(); s = s.length === 1 ? '0' + s : s; + return h + ':' + s; } diff --git a/total-conversion-build.user.js b/total-conversion-build.user.js index c5d78123..10ef3b51 100644 --- a/total-conversion-build.user.js +++ b/total-conversion-build.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id ingress-intel-total-conversion@breunigs // @name intel map total conversion -// @version 0.2-2013-02-05-195233 +// @version 0.2-2013-02-05-200309 // @namespace https://github.com/breunigs/ingress-intel-total-conversion // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js @@ -630,7 +630,9 @@ window.unixTimeToString = function(time, full) { window.unixTimeToHHmm = function(time) { if(!time) return null; var d = new Date(typeof time === 'string' ? parseInt(time) : time); - return d.getHours() + ':' + d.getSeconds(); + var h = '' + d.getHours(); h = h.length === 1 ? '0' + h : h; + var s = '' + d.getSeconds(); s = s.length === 1 ? '0' + s : s; + return h + ':' + s; }