diff --git a/main/calendar/agenda_list.php b/main/calendar/agenda_list.php index 7bf24eb298..82700e4c45 100755 --- a/main/calendar/agenda_list.php +++ b/main/calendar/agenda_list.php @@ -36,6 +36,14 @@ if (!empty($GLOBALS['_cid']) && $GLOBALS['_cid'] != -1) { $this_section = SECTION_COURSES; } else { // Agenda is out of the course tool (e.g personal agenda) + + // Little hack to sort the events by start date in personal agenda (Agenda events List view - See #8014) + usort($events, function($a, $b) { + $t1 = strtotime($a['start']); + $t2 = strtotime($b['start']); + return $t1 - $t2; + }); + $url = false; foreach ($events as &$event) { $event['url'] = api_get_self() . '?cid=' . $event['course_id'] .