Fix support for recurrent tasks (cont'd)

Fixes #3864
This commit is contained in:
Francis Lachapelle
2016-11-01 14:52:18 -04:00
parent 188dd986d2
commit 1ee7693432
6 changed files with 78 additions and 10 deletions
@@ -1007,13 +1007,13 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
{
master = [[[component parent] events] objectAtIndex: 0];
masterEndDate = [master endDate];
endDate = [component endDate];
endDate = [(iCalEvent*) component endDate];
}
else
{
master = [[[component parent] todos] objectAtIndex: 0];
masterEndDate = [master due];
endDate = [component due];
endDate = [(iCalToDo*) component due];
}
delta = [masterEndDate timeIntervalSinceDate: [master startDate]];
@@ -1027,7 +1027,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
if (recordIndex > -1)
{
if ([dateRange containsDate: [component startDate]] ||
[dateRange containsDate: endDate])
(endDate && [dateRange containsDate: endDate]))
{
// We must pass nil to :container here in order to avoid re-entrancy issues.
newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]];
+7 -2
View File
@@ -1,6 +1,6 @@
/* iCalToDot+SOGo.m - this file is part of SOGo
*
* Copyright (C) 2008-2014 Inverse inc.
* Copyright (C) 2008-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
#import <SoObjects/SOGo/WOContext+SOGo.h>
#import <SOGo/CardElement+SOGo.h>
#import <SOGo/NSCalendarDate+SOGo.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
@@ -367,7 +368,11 @@
- (NSTimeInterval) occurenceInterval
{
return [[self due] timeIntervalSinceDate: [self startDate]];
if ([self due])
return [[self due] timeIntervalSinceDate: [self startDate]];
else
// When no due date is defined, base recurrence calculation on a 60-minute duration
return 3600;
}
@end