From 5e1f487e4945be3b62765d583e47861d8b6e8734 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 21 Feb 2020 10:37:58 -0500 Subject: [PATCH] fix(calendar): fix first range of "busy off hours" in vFreeBusy response --- SoObjects/Appointments/SOGoFreeBusyObject.m | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/SoObjects/Appointments/SOGoFreeBusyObject.m b/SoObjects/Appointments/SOGoFreeBusyObject.m index a24835055..d61605832 100644 --- a/SoObjects/Appointments/SOGoFreeBusyObject.m +++ b/SoObjects/Appointments/SOGoFreeBusyObject.m @@ -372,10 +372,23 @@ 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))