From 9a245f18fa9f48a0332bb39a46cce8eb308f81a1 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 15 Mar 2019 13:58:43 -0400 Subject: [PATCH] (core) Handle multidays events in freebusy data --- NEWS | 1 + UI/MainUI/SOGoUserHomePage.m | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/NEWS b/NEWS index ca4e63b96..c941ff740 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Bug fixes - [web] fixed wrong colors assigned to default calendar categories - [core] allow super users to modify any event (#4216) - [core] correctly handle the full cert chain in S/MIME + - [core] handle multidays events in freebusy data 4.0.7 (2019-02-27) ------------------ diff --git a/UI/MainUI/SOGoUserHomePage.m b/UI/MainUI/SOGoUserHomePage.m index c4be5781d..a015e5a63 100644 --- a/UI/MainUI/SOGoUserHomePage.m +++ b/UI/MainUI/SOGoUserHomePage.m @@ -246,6 +246,17 @@ while ([currentDate compare: currentEndDate] == NSOrderedAscending && [currentEndDate timeIntervalSinceDate: currentDate] >= 3600) // 1 hour { + if ([currentDate hourOfDay] == 0) + { + // New day + dayKey = [currentDate shortDateString]; + dayData = [freeBusy objectForKey: dayKey]; + if (!dayData) + { + dayData = [NSMutableDictionary dictionary]; + [freeBusy setObject: dayData forKey: dayKey]; + } + } hourKey = [NSString stringWithFormat: @"%u", (unsigned int)[currentDate hourOfDay]]; hourData = [dayData objectForKey: hourKey]; if (!hourData)