From 66d822c79a29fd138b53ea8d920d24a10cd45433 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 4 Aug 2011 22:59:26 +0200 Subject: [PATCH] Fix event sorting in agenda view (#289): a day should list allday events first --- plugins/calendar/lib/js/fullcalendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/calendar/lib/js/fullcalendar.js b/plugins/calendar/lib/js/fullcalendar.js index 32fe2051..2b0c76ef 100644 --- a/plugins/calendar/lib/js/fullcalendar.js +++ b/plugins/calendar/lib/js/fullcalendar.js @@ -5359,7 +5359,8 @@ function ListEventRenderer() { } function sortCmp(a, b) { - return (a.start.getTime() - b.start.getTime()) + (a.end.getTime() - b.end.getTime()); + var sd = a.start.getTime() - b.start.getTime(); + return sd + (sd ? 0 : a.end.getTime() - b.end.getTime()); } function renderSegs(segs, modifiedEventId) {