Range: xsd:time/dateTime - incorrect seconds range

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
11 years ago
a year ago

People

(Reporter: Merle Sterling, Assigned: Merle Sterling)

Tracking

({fixed1.8.0.12, fixed1.8.1.4})

Trunk
x86
Windows XP
fixed1.8.0.12, fixed1.8.1.4

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

11 years ago
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.
(Assignee)

Comment 1

11 years ago
Created attachment 261724 [details]
testcase: xsd:time

Updated

11 years ago
Assignee: xforms → msterlin
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Updated

11 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

11 years ago
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.
Attachment #261726 - Flags: review?(aaronr)

Updated

11 years ago
Attachment #261726 - Flags: review?(aaronr) → review+
(Assignee)

Updated

11 years ago
Attachment #261726 - Flags: review?(surkov.alexander)

Comment 3

11 years ago
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+
(Assignee)

Comment 4

11 years ago
(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

11 years ago
(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

11 years ago
checked into trunk for msterlin
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Comment 7

11 years ago
checked into 1.8 and 1.8.0 branches
Keywords: fixed1.8.0.12, fixed1.8.1.4
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.