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

oldscoutmaster’s picture

I 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');
-----------------------

jdwfly’s picture

Status: Active » Closed (won't fix)

6.x is in maintenance mode. No new features.