Monotone-Parent: c36e4dbaaa40c95b58d682bbbe6f0a563275afa1

Monotone-Revision: a0ddb6969a3af4885bc30844a5dc0bcda95a8212

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-03-12T20:24:59
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-03-12 20:24:59 +00:00
parent c3f943b7a7
commit d7bca94299
3 changed files with 41 additions and 36 deletions
+6
View File
@@ -1,3 +1,9 @@
2010-03-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentObject.m
(-newOccurenceWithID): moved timezone handling code from
UIxAppointmentEditor to here. Simplified that code.
2010-03-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUserFolder.m (_davFetchUsersMatching:): we
+33 -12
View File
@@ -23,6 +23,7 @@
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSTimeZone.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/WOContext+SoObjects.h>
@@ -79,14 +80,33 @@
- (iCalRepeatableEntityObject *) newOccurenceWithID: (NSString *) recID
{
iCalEvent *newOccurence;
NSCalendarDate *date;
iCalEvent *newOccurence, *master;
NSCalendarDate *date, *firstDate;
unsigned int interval, nbrDays;
SOGoUserDefaults *ud;
NSTimeZone *timeZone;
int daylightOffset;
ud = [[SOGoUser userWithLogin: owner] userDefaults];
timeZone = [ud timeZone];
newOccurence = (iCalEvent *) [super newOccurenceWithID: recID];
date = [newOccurence recurrenceId];
interval = [[newOccurence endDate]
timeIntervalSinceDate: [newOccurence startDate]];
master = [self component: NO secure: NO];
firstDate = [master startDate];
// We are creating a new exception in a recurrent event -- compute the daylight
// saving time with respect to the first occurrence of the recurrent event.
daylightOffset = (int) ([timeZone secondsFromGMTForDate: firstDate]
- [timeZone secondsFromGMTForDate: date]);
if (daylightOffset)
date = [date dateByAddingYears: 0 months: 0 days: 0
hours:0 minutes: 0 seconds: daylightOffset];
[date setTimeZone: timeZone];
interval = [[master endDate]
timeIntervalSinceDate: firstDate];
if ([newOccurence isAllDay])
{
nbrDays = ((float) abs (interval) / 86400) + 1;
@@ -94,14 +114,15 @@
duration: nbrDays];
}
else
[newOccurence setStartDate: date];
[newOccurence setEndDate: [date addYear: 0
month: 0
day: 0
hour: 0
minute: 0
second: interval]];
{
[newOccurence setStartDate: date];
[newOccurence setEndDate: [date addYear: 0
month: 0
day: 0
hour: 0
minute: 0
second: interval]];
}
return newOccurence;
}
+2 -24
View File
@@ -276,33 +276,11 @@
}
else
{
NSCalendarDate *firstDate;
iCalEvent *master;
signed int daylightOffset;
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
// saving time with respect to the first occurrence of the recurrent event.
master = (iCalEvent*)[[event parent] firstChildWithTag: @"vevent"];
firstDate = [master startDate];
if ([timeZone isDaylightSavingTimeForDate: startDate] != [timeZone isDaylightSavingTimeForDate: firstDate])
{
daylightOffset = (signed int)[timeZone secondsFromGMTForDate: firstDate]
- (signed int)[timeZone secondsFromGMTForDate: startDate];
startDate = [startDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset];
}
}
isAllDay = [event isAllDay];
endDate = [event endDate];
if (isAllDay)
endDate = [[event endDate] dateByAddingYears: 0 months: 0 days: -1];
else
endDate = [[event endDate] dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset];
endDate = [endDate dateByAddingYears: 0 months: 0 days: -1];
isTransparent = ![event isOpaque];
}