Closed
Bug 281411
Opened 20 years ago
Closed 20 years ago
The "Remaining Time" value should not be negative for too large "Hours Worked" values
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: LpSolit, Assigned: LpSolit)
Details
Attachments
(1 file)
|
935 bytes,
patch
|
Wurblzap
:
review+
|
Details | Diff | Splinter Review |
When the "Hours Worked" field has a value which is larger than the one in the "Hours Left" field, a negative value is calculated and is then rejected by ValidateTime(). To treat this case correctly, you only have to set a value of zero instead of a negative value, see bug/edit.html.tmpl, lines 100-101: new_time = Math.max(fRemainingTime - document.changeform.work_time.value, 0.0); Here, I have added Math.max(..., 0.0) so that "new_time" is never negative, as it should be.
| Assignee | ||
Comment 1•20 years ago
|
||
prevent negative values for "Hours Left"...
Comment 2•20 years ago
|
||
Comment on attachment 173808 [details] [diff] [review] trivial patch, v1 r=wurblzap by inspection. > // subtracts time spent from remaining time > var new_time; > >+ // prevent negative values if work_time > fRemainingTime Nit: it's imho clearer if you merged the two comments, along the lines of "substract time spent from remaining time; take care not to let that drop below zero" or something. If you do that, please carry r+ forward.
Attachment #173808 -
Flags: review? → review+
| Assignee | ||
Updated•20 years ago
|
Flags: approval?
Flags: approval2.18?
Target Milestone: --- → Bugzilla 2.18
Updated•20 years ago
|
Flags: approval? → approval+
Comment 3•20 years ago
|
||
Checked in on tip: Checking in template/en/default/bug/edit.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl,v <-- edit.html.tmpl new revision: 1.55; previous revision: 1.54 done Awaiting a+/a- on 2.18 before resolving.
Updated•20 years ago
|
Whiteboard: Checked in on 2.20: awaiting approval for 2.18
Updated•20 years ago
|
Flags: approval2.18? → approval2.18+
Comment 4•20 years ago
|
||
Checked in on 2.18. Checking in template/en/default/bug/edit.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl,v <-- edit.html.tmpl new revision: 1.40.2.6; previous revision: 1.40.2.5 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Whiteboard: Checked in on 2.20: awaiting approval for 2.18
You need to log in
before you can comment on or make changes to this bug.
Description
•