Dont show weird infinity / nan messages

This commit is contained in:
james 2010-03-25 21:22:40 +00:00
parent a3417c7a50
commit 096287908d

View File

@ -72,8 +72,9 @@ function updateStatus() {
avgtimeperpercent=deltatime/deltapercent;
remainingpercent=100-obj[0];
remainingtime=remainingpercent*avgtimeperpercent;
if(remainingtime && obj[0]>0)
if(remainingtime>0 && remainingtime!="Infinity" && obj[0]>0) {
$("#schedulereta").html(format_duration(Math.round(remainingtime/1000)));
}
else
$("#schedulereta").html("Calculating...");
}
@ -116,7 +117,9 @@ function format_duration(seconds) {
output+=minutes+' minute'+pl+' ';
}
if(s>1) pl='s'; else pl='';
output+=s+' second'+pl;
if(!s)
output+='Unknown';
return output;
}