Closed Bug 377702 Opened 17 years ago Closed 17 years ago

Range: xsd:time/dateTime - incorrect seconds range

Categories

(Core Graveyard :: XForms, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: msterlin, Assigned: msterlin)

Details

(Keywords: fixed1.8.0.12, fixed1.8.1.4)

Attachments

(2 files)

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.
Attached file testcase: xsd:time
Assignee: xforms → msterlin
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
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.
Attachment #261726 - Flags: review?(aaronr)
Attachment #261726 - Flags: review?(aaronr) → review+
Attachment #261726 - Flags: review?(surkov.alexander)
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.
Attachment #261726 - Flags: review?(surkov.alexander) → review+
(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.

(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.
checked into trunk for msterlin
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
checked into 1.8 and 1.8.0 branches
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: