oc-calendar: wDay field cannot be negative
Furthermore, [MS-OXOCAL] Section 2.2.1.41.1 indicates: The wDay field is set to indicate the occurrence of the day of the week within the month (1 to 5, where 5 indicates the final occurrence during the month if that day of the week does not occur 5 times). [rule firstOccurrence] may return negative values according to iCal spec for recurrent rules iCal 4.8.5.4 Recurrence Rule. For instance, for defining a timezone whose recurrent rule is done using this rule: RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU This fixes the problem when editing a recurrent appointment in Outlook were incorrectly shifted when SOGo provides back the event.pull/69/head
parent
be60fdebcc
commit
cd64ca199a
|
@ -51,6 +51,7 @@
|
|||
NSArray *byMonth;
|
||||
iCalByDayMask *mask;
|
||||
NSCalendarDate *dateValue;
|
||||
int16_t wDay;
|
||||
|
||||
rrule = [self recurrenceRule];
|
||||
byMonth = [rrule byMonth];
|
||||
|
@ -59,7 +60,14 @@
|
|||
tzData->wMonth = [[byMonth objectAtIndex: 0] intValue];
|
||||
mask = [rrule byDayMask];
|
||||
tzData->wDayOfWeek = [mask firstDay];
|
||||
tzData->wDay = [mask firstOccurrence];
|
||||
wDay = [mask firstOccurrence];
|
||||
if (wDay < 0)
|
||||
/* [MS-OXOCAL] the wDay field is set to indicate the
|
||||
occurrence of the day of the week within the month (1 to
|
||||
5, where 5 indicates the final occurrence during the
|
||||
month if that day of the week does not occur 5 times). */
|
||||
wDay += 6;
|
||||
tzData->wDay = (uint16_t) wDay;
|
||||
|
||||
dateValue = [self startDate];
|
||||
tzData->wHour = [dateValue hourOfDay];
|
||||
|
|
Loading…
Reference in New Issue