From db56c51ee6520dc23de5cdde41e3d2e1fcf4a3bf Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" <> Date: Thu, 17 Feb 2005 00:50:38 +0000 Subject: Bug 281411 : The "Remaining Time" value should not be negative for too large "Hours Worked" values Patch by Frederic Buclin r=wurblzap a=myk --- template/en/default/bug/edit.html.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'template/en') diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 613bfb4d4..4514350bc 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -97,8 +97,9 @@ // subtracts time spent from remaining time var new_time; + // prevent negative values if work_time > fRemainingTime new_time = - fRemainingTime - document.changeform.work_time.value; + Math.max(fRemainingTime - document.changeform.work_time.value, 0.0); // get upto 2 decimal places document.changeform.remaining_time.value = Math.round(new_time * 100)/100; -- cgit v1.2.3-24-g4f1b