$sidebarEvent = '<h4 class="scheduler_sidebar_link"><a href="{*URL*}#date={*DATE_SQL*},mode=month" target="_blank">{*DATE*}</a></h4>
                 <div class="scheduler_sidebar_text">{*TEXT*}</div>';

This can be a snippet from the wordpress plugin that I am using. It prints event date then description. How do you modify it to ensure that all same-day occasions are printed together as you list?

This is actually the relevant function inside a separate file:

for ($i = 0; $i < count($events); $i++) {
        $event = $sidebarEvent;
        $start_date = str_replace("-", "/", $events[$i]->start_date);
        $start_date = date_parse($events[$i]->start_date);
        $start_date = mktime($start_date['hour'], $start_date['minute'], $start_date['second'], $start_date['month'], $start_date['day'], $start_date['year']);
        $start_date = date(get_option('date_format').' '.get_option('time_format'), $start_date);
        $event = str_replace("{*URL*}", $url, $event);
        $event = str_replace("{*DATE*}", $start_date, $event);
        $event = str_replace("{*DATE_SQL*}", $events[$i]->start_date, $event);
        $event = str_replace("{*TEXT*}", $events[$i]->text, $event);
        $final .= $event;
    }

Thanks

You are able to collect yourself them under their date values.

$event_groups = array();
foreach($events as $event) {
  if(!isset($event_groups[$event->start_date]))
    $event_groups[$event->start_date] = array();

  $event_groups[$event->start_date] = $event;
}

Which will make you together with arrays of occasions organized 'date' => Array($event, $event, ...).

After that you are able to use the whole arranged list:

foreach($event_groups as $date => $events) {
  for ($i = 0; $i < count($events); $i++) {
    $event = $sidebarEvent;
    $start_date = str_replace("-", "/", $events[$i]->start_date);
    $start_date = date_parse($events[$i]->start_date);
    $start_date = mktime($start_date['hour'], $start_date['minute'], $start_date['second'], $start_date['month'], $start_date['day'], $start_date['year']);
    $start_date = date(get_option('date_format').' '.get_option('time_format'), $start_date);
    $event = str_replace("{*URL*}", $url, $event);
    $event = str_replace("{*DATE*}", $start_date, $event);
    $event = str_replace("{*DATE_SQL*}", $events[$i]->start_date, $event);
    $event = str_replace("{*TEXT*}", $events[$i]->text, $event);
    $final .= $event;
  }
}

or get a listing of occasions for any specific date:

$list = $event_groups['2010-02-13'];