Last Comment Bug 377702 - Range: xsd:time/dateTime - incorrect seconds range
: Range: xsd:time/dateTime - incorrect seconds range
Status: RESOLVED FIXED
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Merle Sterling
: Stephen Pride
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-16 14:12 PDT by Merle Sterling
Modified: 2016-07-15 14:46 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
testcase: xsd:time (1.08 KB, text/xml)
2007-04-16 14:17 PDT, Merle Sterling
no flags Details
patch (4.45 KB, patch)
2007-04-16 14:26 PDT, Merle Sterling
aaronr: review+
surkov.alexander: review+
Details | Diff | Splinter Review

Description Merle Sterling 2007-04-16 14:12:03 PDT
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; formsPlayer 1.4; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070412 Minefield/3.0a4pre

The calculated min and max for the range of seconds is incorrect when the current hours equals the start or end hours. When the current hours is equal to the start or end hours, the range of seconds depends on the current minutes.

Reproducible: Always

Steps to Reproduce:
Run the attached testcase. The seconds range should be from 0 to 59 unless the hours is incremented to equal the end hours.
Comment 1 Merle Sterling 2007-04-16 14:17:07 PDT
Created attachment 261724 [details]
testcase: xsd:time
Comment 2 Merle Sterling 2007-04-16 14:26:11 PDT
Created attachment 261726 [details] [diff] [review]
patch

Update getMin/MaxSeconds methods of dateTime to take into account current minutes when the current hours equals the start or end hours.

The patch was also regression tested against the testcases from bug372736.
Comment 3 alexander :surkov 2007-04-18 19:12:21 PDT
Comment on attachment 261726 [details] [diff] [review]
patch


>-          if (startMinutes == endMinutes || currentMinutes == startMinutes) {

Is it enough here to check currentMinutes == startMinutes only?

>-          if (startMinutes == endMinutes || currentMinutes == endMinutes) {

the same here.

r=me with answered and fixed if needed.
Comment 4 Merle Sterling 2007-04-19 07:46:49 PDT
(In reply to comment #3)
> (From update of attachment 261726 [details] [diff] [review])
> >-          if (startMinutes == endMinutes || currentMinutes == startMinutes) {
> Is it enough here to check currentMinutes == startMinutes only?
> >-          if (startMinutes == endMinutes || currentMinutes == endMinutes) {
> the same here.
> r=me with answered and fixed if needed.

No because on the initial refresh there may not be a current value. A similar test for start=end || current=start/end is done in each of the getMin/Max methods of the range widgets.

Comment 5 alexander :surkov 2007-04-19 07:59:55 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 261726 [details] [diff] [review] [details])
> > >-          if (startMinutes == endMinutes || currentMinutes == startMinutes) {
> > Is it enough here to check currentMinutes == startMinutes only?
> > >-          if (startMinutes == endMinutes || currentMinutes == endMinutes) {
> > the same here.
> > r=me with answered and fixed if needed.
> 
> No because on the initial refresh there may not be a current value. A similar
> test for start=end || current=start/end is done in each of the getMin/Max
> methods of the range widgets.
> 

Ah, ok.
Comment 6 aaronr 2007-04-19 18:46:56 PDT
checked into trunk for msterlin
Comment 7 aaronr 2007-04-24 19:11:52 PDT
checked into 1.8 and 1.8.0 branches

Note You need to log in before you can comment on or make changes to this bug.