]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 281411 : The "Remaining Time" value should not be negative for too large "Hours...
authortravis%sedsystems.ca <>
Thu, 17 Feb 2005 00:50:38 +0000 (00:50 +0000)
committertravis%sedsystems.ca <>
Thu, 17 Feb 2005 00:50:38 +0000 (00:50 +0000)
Patch by Frederic Buclin <LpSolit@gmail.com>  r=wurblzap  a=myk

template/en/default/bug/edit.html.tmpl

index 613bfb4d4be303eaba143250094de2758891dec5..4514350bcc0cc037016c1018334faabdfe0537fc 100644 (file)
@@ -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;