Skip to content

Commit

Permalink
fix(calendar): fix first range of "busy off hours" in vFreeBusy response
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Feb 21, 2020
1 parent 989021d commit 5e1f487
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions SoObjects/Appointments/SOGoFreeBusyObject.m
Expand Up @@ -372,10 +372,23 @@ - (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) startDate
if ([endDate compare: currentEndDate] == NSOrderedAscending)
currentEndDate = endDate;

[infos addObject: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool: YES], @"c_isopaque",
([currentStartDate compare: startDate] == NSOrderedAscending)? startDate : currentStartDate, @"startDate",
currentEndDate, @"endDate", nil]];
if ([currentStartDate compare: startDate] == NSOrderedAscending)
{
if ([startDate compare: currentEndDate] == NSOrderedAscending)
{
[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
&& ([currentEndDate dayOfWeek] == 6 || [currentEndDate dayOfWeek] == 0))
Expand Down

0 comments on commit 5e1f487

Please sign in to comment.