Closed (won't fix)
Project:
GCal Events
Version:
6.x-1.4
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2009 at 15:36 UTC
Updated:
15 Apr 2013 at 16:51 UTC
Hello,
I was playing around with the module and I noticed that, if there are two events on the same day, one all-day and another with a time, they are ordered alphabetically based on the event name. Is there any way to always have the all-day event listed first, followed by the other events in that day?
Thank you.
Comments
Comment #1
oldscoutmaster commentedI implemented sorting logic that places All Day events ahead of the other events. It works for me, but I've not fully tested it. Because the 6.x-1.4 version has been updated, I used the dev version.
In the 6.x-1.x-dev version date 2011-Apr-11 at lines 813-816, replace:
-----------------------
//Sort this
sort($events);
gcal_events_debug_block($admin_name, 'Feed processing took ' . round((microtime(true) - $time_feed_process),2) . ' seconds');
-----------------------
with:
-----------------------
//Sort this
// modified by YOURNAME - DATE commented out sort($events); line and added
// declaring arrays of datecol and alldaycol, and "Obtain list of columns and Sort
// the data with datacol and alldaycol descending."
//sort($events);
$datecol = array();
$alldaycol = array();
// Obtain a list of columns
foreach ($events as $key => $row) {
$datecol[$key] = $row['date'];
$alldaycol[$key] = $row['allday'];
}
// Sort the data
// Add $events as the last parameter, to sort by the common key
array_multisort($datecol, SORT_ASC, $alldaycol, SORT_DESC, $events);
// END of modified sorting routine
gcal_events_debug_block($admin_name, 'Feed processing took ' . round((microtime(true) - $time_feed_process),2) . ' seconds');
-----------------------
Comment #2
jdwfly commented6.x is in maintenance mode. No new features.