time formatting updated
This commit is contained in:
parent
4f6c98c563
commit
ca3f32a130
|
@ -165,6 +165,7 @@ function changeLength(len, pref) {
|
||||||
}
|
}
|
||||||
function changeTime(time) {
|
function changeTime(time) {
|
||||||
time = parseInt(time);
|
time = parseInt(time);
|
||||||
|
if(!time) return "infinite";
|
||||||
if(time < 60) return time + " s";
|
if(time < 60) return time + " s";
|
||||||
else if(time < 60*60) return (time/60).toFixed(2) + " min";
|
else if(time < 60*60) return (time/60).toFixed(2) + " min";
|
||||||
else if(time < 60*60*24) return (time/(60*60)).toFixed(2) + " hours";
|
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);
|
var eta = changeTime((data.totalLength-data.completedLength)/data.downloadSpeed);
|
||||||
if(!eta) eta = "infinite";
|
|
||||||
return {
|
return {
|
||||||
name: name,
|
name: name,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user