From 64c1c126c0888126fa41a82ec8b2075a855ce186 Mon Sep 17 00:00:00 2001 From: nicorac Date: Tue, 18 Dec 2018 16:04:22 +0100 Subject: [PATCH] Function calendar_ical.aggregate_periods() returns only the last event --- calendar/inc/class.calendar_ical.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index d8fd5da112..d161c81773 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -3300,9 +3300,9 @@ class calendar_ical extends calendar_boupdate // sort by start datetime uasort($events, function($a, $b) { - $diff = $a['start'] < $b['start']; + $diff = $a['start'] - $b['start']; - return !$diff ? 0 : ($diff < 0 ? -1 : 1); + return $diff == 0 ? 0 : ($diff < 0 ? -1 : 1); }); $fbdata = array();