From 0d15677fbc139502e072b5eab8701c22aa1b6472 Mon Sep 17 00:00:00 2001 From: "jminta%gmail.com" Date: Mon, 3 Apr 2006 15:25:01 +0000 Subject: [PATCH] Bug 332443 In weekview, dragging an item to a different day and different time ends up at the wrong time, r=mvl --- calendar/base/content/calendar-multiday-view.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/calendar/base/content/calendar-multiday-view.xml b/calendar/base/content/calendar-multiday-view.xml index 7cf488d18abe..f7fb3abd4d8f 100644 --- a/calendar/base/content/calendar-multiday-view.xml +++ b/calendar/base/content/calendar-multiday-view.xml @@ -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);