rem: var endDiff = instance.endDate.subtractDate(aOccurrence.endDate); 
add:   var instanceEnd = instance.endDate || instance.dueDate; var occEnd = aOccurrence.endDate || aOccurrence.dueDate; var endDiff = instanceEnd.subtractDate(occEnd); 
context:     modifyOccurrence: function (aOccurrence, aNewStartTime, aNewEndTime) {        // if we can modify this thing directly (e.g. just the time changed),        // then do so; otherwise pop up the dialog        var itemToEdit;        if (aNewStartTime && aNewEndTime) {            itemToEdit = getOccurrenceOrParent(aOccurrence);            var instance = itemToEdit.clone();            // if we're about to modify the parentItem, we need to account            // for the possibility that the item passed as argument was            // some other occurrence, but the user said she would like to            // modify all ocurrences instead.  In that case, we need to figure            // out how much the occurrence moved, and move the occurrence by            // that amount.            if (instance.parentItem.hasSameIds(instance)) {                var startDiff = instance.startDate.subtractDate(aOccurrence.startDate);                aNewStartTime = aNewStartTime.clone();                aNewStartTime.addDuration(startDiff);                var endDiff = instance.endDate.subtractDate(aOccurrence.endDate);                aNewEndTime = aNewEndTime.clone();                aNewEndTime.addDuration(endDiff);            }            instance.startDate = aNewStartTime;            instance.endDate = aNewEndTime;            doTransaction('modify', instance, instance.calendar, itemToEdit, null);        } else {            //XXX unify these            if ("editEvent" in window) {                // Sunbird specific code                editEvent();            } else {                // Lightning specific code                itemToEdit = getOccurrenceOrParent(aOccurrence);                modifyEventWithDialog(itemToEdit);            }        }    },
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/11e07aa0cc3bb3b10c7a301cc6f5702a9f8ae3d9/calendar-views.js/buggy/calendar/base/content/calendar-views.js