diff --git a/ChangeLog b/ChangeLog index 151c9b858..3d36fb7ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-12-30 Francis Lachapelle + * SoObjects/Appointments/SOGoAppointmentObject.m + ([SOGoAppointmentObject -newOccurenceWithID:]): fixed the start + date when returning an occurrence of an all-day event. + * SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -fixupCycleRecord:cycleRange:firstInstanceCalendarDateRange:forViewRange:]): diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 02961ac9e..b854f87c6 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -139,13 +139,21 @@ { iCalEvent *newOccurence; NSCalendarDate *date; - unsigned int interval; + unsigned int interval, nbrDays; newOccurence = (iCalEvent *) [super newOccurenceWithID: recID]; date = [newOccurence recurrenceId]; interval = [[newOccurence endDate] timeIntervalSinceDate: [newOccurence startDate]]; - [newOccurence setStartDate: date]; + if ([newOccurence isAllDay]) + { + nbrDays = ((float) abs (interval) / 86400) + 1; + [newOccurence setAllDayWithStartDate: date + duration: nbrDays]; + } + else + [newOccurence setStartDate: date]; + [newOccurence setEndDate: [date addYear: 0 month: 0 day: 0 diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 1d9410a9f..474f47611 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -232,7 +232,7 @@ startDate = [event startDate]; daylightOffset = 0; - + if ([co isNew] && [co isKindOfClass: [SOGoAppointmentOccurence class]]) { // We are creating a new exception in a recurrent event -- compute the daylight @@ -416,10 +416,10 @@ } } data = [NSDictionary dictionaryWithObjectsAndKeys: - [dateFormatter formattedDate: eventDate], @"startDate", + [dateFormatter formattedDate: eventDate], @"startDate", [dateFormatter formattedTime: eventDate], @"startTime", ([event hasRecurrenceRules]? @"1": @"0"), @"isReccurent", - ([event isAllDay] ? @"1": @"0"), @"isAllDay", + ([event isAllDay]? @"1": @"0"), @"isAllDay", [event summary], @"summary", [event location], @"location", [event comment], @"description",