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:
jminta%gmail.com 2006-04-03 15:25:01 +00:00
parent b5406fa0be
commit 0d15677fbc

View File

@ -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);