From: travis%sedsystems.ca <> Date: Fri, 18 Feb 2005 14:18:27 +0000 (+0000) Subject: Bug 281411 : The "Remaining Time" value should not be negative for too large "Hours... X-Git-Tag: bugzilla-2.18.1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9b96dbeba6b9c6628c4286c4aec8503dcbcefa7;p=thirdparty%2Fbugzilla.git Bug 281411 : The "Remaining Time" value should not be negative for too large "Hours Worked" values Patch by Frederic Buclin r=wurblzap a=justdave --- diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 35344c88dd..fda1826964 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;