Closed Bug 332443 Opened 14 years ago Closed 14 years ago

in weekview, dragging an item to a different day and different time ends up at the wrong time

Categories

(Calendar :: Sunbird Only, defect)

x86
All
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mvl, Assigned: jminta)

References

Details

Attachments

(1 file)

I have an event that start saturday 9:00. If i drag it to friday 10:00, it ends up starting firday at 8:00. If I drag it to friday 11:00, it ends up as firday 7:00.

So instead of n hours later, it becomes n hours earlier. (also for fractional n's. 9:15 becomes 8:45)
Looks like addition instead of substraction, somewhere.

Note that all works correctly when dragging within the same day. Also, dragging from friday to saturday works (or from any day to a day later)
I can confirm on windows and linux.
Works in linux-i686-2006-03-26-07-trunk build.
Fails in linux-i686-2006-03-27-07-trunk build.
OS: Linux → All
Some quick dumps made in onEventSweepMouseUp() in http://lxr.mozilla.org/mozilla/source/calendar/base/content/calendar-multiday-view.xml#1044 shows that mvl guess is right:

Moving event from 2006/04/01 12:00 to 2006/04/02 13:00 is OK

    move - before adaptation - dur   = P1D
           before adaptation - start = 2006/04/01 12:00:00
           before adaptation - end   = 2006/04/01 14:00:00

    move - after adaptation  - dur   = P1DT1H
           after adaptation  - start = 2006/04/02 13:00:00
           after adaptation  - end   = 2006/04/02 15:00:00

Moving event from 2006/04/02 13:00 back to 2006/04/01 12:00 is not OK,
the calculated move duration is -PT23H instead of -P1DT1H as expected:

    move - before adaptation - dur   = -P1D
           before adaptation - start = 2006/04/02 13:00:00
           before adaptation - end   = 2006/04/02 15:00:00

    move - after adaptation  - dur   = -PT23H
           after adaptation  - start = 2006/04/01 14:00:00
           after adaptation  - end   = 2006/04/01 16:00:00
       
As the result the event is not shown at 12:00 but at 14:00.
Attached patch get correct signSplinter Review
When dragging to a different day, we end up with a negative duration.  This means that we need to actually flip the sign of the minutes offset.
Assignee: nobody → jminta
Status: NEW → ASSIGNED
Attachment #216916 - Flags: first-review?(mvl)
Comment on attachment 216916 [details] [diff] [review]
get correct sign

r=mvl
Attachment #216916 - Flags: first-review?(mvl) → first-review+
Patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060929 Sunbird/0.3
Whiteboard: [litmus testcase wanted]
Status: RESOLVED → VERIFIED
Litmus testcase 2427 created
Whiteboard: [litmus testcase wanted]
You need to log in before you can comment on or make changes to this bug.