From 096287908dbef87f06b8f50800d6f92e98bcaf99 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 25 Mar 2010 21:22:40 +0000 Subject: [PATCH] Dont show weird infinity / nan messages --- admin/judges_scheduler_status.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/judges_scheduler_status.php b/admin/judges_scheduler_status.php index 49c6f41d..c44955aa 100644 --- a/admin/judges_scheduler_status.php +++ b/admin/judges_scheduler_status.php @@ -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; }