From ca3f32a1301171de06482e7f0aeeac86c46133bb Mon Sep 17 00:00:00 2001 From: Hamza Zia Date: Wed, 6 Jun 2012 16:09:48 +0800 Subject: [PATCH] time formatting updated --- js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index c370b5d..c09d397 100755 --- a/js/script.js +++ b/js/script.js @@ -165,6 +165,7 @@ function changeLength(len, pref) { } function changeTime(time) { time = parseInt(time); + if(!time) return "infinite"; if(time < 60) return time + " s"; else if(time < 60*60) return (time/60).toFixed(2) + " min"; else if(time < 60*60*24) return (time/(60*60)).toFixed(2) + " hours"; @@ -184,7 +185,6 @@ function getTemplateCtx(data) { } var eta = changeTime((data.totalLength-data.completedLength)/data.downloadSpeed); - if(!eta) eta = "infinite"; return { name: name, status: data.status,