diff --git a/admin/judges_scheduler_status.php b/admin/judges_scheduler_status.php index 77d2f6c..49c6f41 100644 --- a/admin/judges_scheduler_status.php +++ b/admin/judges_scheduler_status.php @@ -95,23 +95,28 @@ function format_duration(seconds) { */ var s=seconds; - var output=s+':'; + var output=''; + var pl=''; if(s>86400) { var days=Math.floor(s/86400) s-=days*86400; - output+=days+' days '; + if(days>1) pl='s'; else pl=''; + output+=days+' day'+pl+' '; } if(s>3600) { var hours=Math.floor(s/3600) s-=hours*3600; - output+=hours+' hours '; + if(hours>1) pl='s'; else pl=''; + output+=hours+' hour'+pl+' '; } if(s>60) { var minutes=Math.floor(s/60) s-=minutes*60; - output+=minutes+' minutes '; + if(minutes>1) pl='s'; else pl=''; + output+=minutes+' minute'+pl+' '; } - output+=s+' seconds '; + if(s>1) pl='s'; else pl=''; + output+=s+' second'+pl; return output; }