- Revision
- 11133
- Author
- jeffrey
- Date
- 2006-07-11 17:45:02 -0700 (Tue, 11 Jul 2006)
Log Message
[alpha3 branch] Fix for bug 6174, recurrenceID is off when working
with all day occurrences, r=grant
Munge recurrenceID appropriately when allDay is set or unset.
with all day occurrences, r=grant
Munge recurrenceID appropriately when allDay is set or unset.
Modified Paths
Diff
Modified: branches/0.7alpha3/chandler/parcels/osaf/pim/calendar/Calendar.py (11132 => 11133)
--- branches/0.7alpha3/chandler/parcels/osaf/pim/calendar/Calendar.py 2006-07-12 00:42:03 UTC (rev 11132) +++ branches/0.7alpha3/chandler/parcels/osaf/pim/calendar/Calendar.py 2006-07-12 00:45:02 UTC (rev 11133) @@ -1147,9 +1147,24 @@ isFirst = (recurrenceID == master.startTime) self._ignoreValueChanges = True - if attr == 'startTime': - startTimeDelta = (value - self.startTime) - self.rruleset.moveDatesAfter(recurrenceID, startTimeDelta) + # all day events' startTime is at midnight + startMidnight = datetime.combine(self.startTime.date(), + time(0, tzinfo=self.startTime.tzinfo)) + + if attr in ('startTime', 'allDay'): + startTimeDelta = zero_delta + if attr == 'startTime': + startTimeDelta = (value - self.startTime) + # the recurrence dialog often gets extra changes buffered, don't + # process allDay unless it's actually changed + elif self.allDay != value: + if value == False: + startTimeDelta = self.startTime - startMidnight + else: + startTimeDelta = startMidnight - self.startTime + + if startTimeDelta != zero_delta: + self.rruleset.moveDatesAfter(recurrenceID, startTimeDelta) setattr(self, attr, value) @@ -1164,7 +1179,10 @@ self._makeGeneralChange() # Make this event a separate event from the original rule del self.modificationFor - self.recurrenceID = self.startTime + if self.allDay: + self.recurrenceID = startMidnight + else: + self.recurrenceID = self.startTime self.icalUID = unicode(self.itsUUID) self.copyCollections(master, self)
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
