1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 15:34:11 +01:00
This commit is contained in:
Kris Maglione
2012-04-20 12:52:29 -04:00
parent 17cb6a8993
commit ec8ffc7405
3 changed files with 16 additions and 13 deletions

View File

@@ -627,10 +627,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
*/
formatSeconds: function formatSeconds(seconds) {
function pad(n, val) ("0000000" + val).substr(-Math.max(n, String(val).length));
function div(num, denom) [Math.round(num / denom), Math.round(num % denom)];
function div(num, denom) [Math.floor(num / denom), Math.round(num % denom)];
let days, hours, minutes;
[minutes, seconds] = div(seconds, 60);
[minutes, seconds] = div(Math.round(seconds), 60);
[hours, minutes] = div(minutes, 60);
[days, hours] = div(hours, 24);
if (days)