Skip to content

Commit

Permalink
fix(calendar): adjust recurrent rule when importing a vEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Jan 20, 2020
1 parent 0e5514e commit 560c1dc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions SoObjects/Appointments/iCalEvent+SOGo.m
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,23 @@ - (iCalTimeZone *) adjustInContext: (WOContext *) context
[self errorWithFormat: @"Broken all-day event; setting end date to %@ for UID %@", [self endDate], [self uid]];
}

if ([self isRecurrent])
{
NSArray *rules;
iCalRecurrenceRule *rule;

rules = [self recurrenceRules];
if ([rules count] > 0)
{
// Consider first rule only
rule = [rules objectAtIndex: 0];
if ([rule repeatCount] && [rule untilDate])
{
[self errorWithFormat: @"Recurrent event with both repeat count (%i) and until date (%@); dropping until date", [rule repeatCount], [rule untilDate]];
[rule setUntil: nil];
}
}
}

return timezone;

Expand Down

0 comments on commit 560c1dc

Please sign in to comment.