mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 332443 In weekview, dragging an item to a different day and different time ends up at the wrong time, r=mvl
This commit is contained in:
parent
b5406fa0be
commit
0d15677fbc
@ -1043,9 +1043,16 @@
|
||||
if (dragState.dragType == "move") {
|
||||
// Figure out how much the event moved.
|
||||
var duration = col.mDate.subtractDate(dragState.origDate);
|
||||
|
||||
duration.minutes = dragState.startMin - dragState.origMin;
|
||||
var minutes = dragState.startMin - dragState.origMin;
|
||||
if (duration.isNegative) {
|
||||
// Adding negative minutes to a negative duration makes the
|
||||
// duration more positive, but we want more negative, and
|
||||
// vice versa.
|
||||
minutes *= -1;
|
||||
}
|
||||
duration.minutes = minutes;
|
||||
duration.normalize();
|
||||
|
||||
newStart.addDuration(duration);
|
||||
newStart.normalize();
|
||||
newEnd.addDuration(duration);
|
||||
|
Loading…
Reference in New Issue
Block a user