oc-calendar: Fix PidLidClipStart on recurrent events

The midnight value must be in user's timezone and returned back in UTC.
pull/69/head
Enrique J. Hernández Blasco 2014-10-16 16:29:23 +02:00 committed by Julio García
parent c631689975
commit 35ca313c37
1 changed files with 11 additions and 2 deletions

View File

@ -791,11 +791,20 @@ static NSCharacterSet *hexCharacterSet = nil;
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
NSCalendarDate *dateValue, *start;
if ([event isRecurrent])
{
dateValue = [[event startDate] hour: 0 minute: 0 second: 0];
/* [MS-OXOCAL] For a recurring series, this property specifies
midnight in the user's machine time zone, on the date of the
first instance, then is persisted in UTC. */
start = [event startDate];
dateValue = [NSCalendarDate dateWithYear: [start yearOfCommonEra]
month: [start monthOfYear]
day: [start dayOfMonth]
hour: 0 minute: 0 second: 0
timeZone: timeZone];
[dateValue setTimeZone: utcTZ];
*data = [dateValue asFileTimeInMemCtx: memCtx];
rc = MAPISTORE_SUCCESS;
}