fix(calendar): fix first range of "busy off hours" in vFreeBusy response

pull/270/head
Francis Lachapelle 2020-02-21 10:37:58 -05:00
parent 989021d561
commit 5e1f487e49
1 changed files with 17 additions and 4 deletions

View File

@ -372,10 +372,23 @@
if ([endDate compare: currentEndDate] == NSOrderedAscending) if ([endDate compare: currentEndDate] == NSOrderedAscending)
currentEndDate = endDate; currentEndDate = endDate;
[infos addObject: [NSDictionary dictionaryWithObjectsAndKeys: if ([currentStartDate compare: startDate] == NSOrderedAscending)
[NSNumber numberWithBool: YES], @"c_isopaque", {
([currentStartDate compare: startDate] == NSOrderedAscending)? startDate : currentStartDate, @"startDate", if ([startDate compare: currentEndDate] == NSOrderedAscending)
currentEndDate, @"endDate", nil]]; {
[infos addObject: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool: YES], @"c_isopaque",
startDate, @"startDate",
currentEndDate, @"endDate", nil]];
}
}
else
{
[infos addObject: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool: YES], @"c_isopaque",
currentStartDate, @"startDate",
currentEndDate, @"endDate", nil]];
}
if (currentEndDate != endDate if (currentEndDate != endDate
&& ([currentEndDate dayOfWeek] == 6 || [currentEndDate dayOfWeek] == 0)) && ([currentEndDate dayOfWeek] == 6 || [currentEndDate dayOfWeek] == 0))