forked from science-ation/science-ation
Dont show weird infinity / nan messages
This commit is contained in:
parent
a3417c7a50
commit
096287908d
@ -72,8 +72,9 @@ function updateStatus() {
|
|||||||
avgtimeperpercent=deltatime/deltapercent;
|
avgtimeperpercent=deltatime/deltapercent;
|
||||||
remainingpercent=100-obj[0];
|
remainingpercent=100-obj[0];
|
||||||
remainingtime=remainingpercent*avgtimeperpercent;
|
remainingtime=remainingpercent*avgtimeperpercent;
|
||||||
if(remainingtime && obj[0]>0)
|
if(remainingtime>0 && remainingtime!="Infinity" && obj[0]>0) {
|
||||||
$("#schedulereta").html(format_duration(Math.round(remainingtime/1000)));
|
$("#schedulereta").html(format_duration(Math.round(remainingtime/1000)));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$("#schedulereta").html("Calculating...");
|
$("#schedulereta").html("Calculating...");
|
||||||
}
|
}
|
||||||
@ -116,7 +117,9 @@ function format_duration(seconds) {
|
|||||||
output+=minutes+' minute'+pl+' ';
|
output+=minutes+' minute'+pl+' ';
|
||||||
}
|
}
|
||||||
if(s>1) pl='s'; else pl='';
|
if(s>1) pl='s'; else pl='';
|
||||||
output+=s+' second'+pl;
|
|
||||||
|
if(!s)
|
||||||
|
output+='Unknown';
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user