Here’s the code that finally worked for me:
<?php
global $events_meta_termine;
$today = getdate();
$my_query = new WP_Query('post_type=events&posts_per_page=-1&monthnum='.$today["mon"]);
$events=array();
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
$meta = get_post_meta(get_the_ID(), $events_meta_termine->get_the_id(), TRUE);
foreach ($meta['termin_group'] as $termin)
{
$event=array();
$event['title']=get_the_title();
$event['date']=$termin['termin_date'];
$event['time']=$termin['termin_time'];
$event['location']=$termin['termin_location'];
$events[]=$event;
}
endwhile;
wp_reset_query();
$i=0;
usort($events, "cmp");
function cmp($a, $b){
return strcmp($a['date'],$b['date']);
} ?>
<table>
<?php $current_month="";
foreach ($events as $event){
if ($current_month!=mysql2date('F Y', $event['date'], true))
{
$current_month=mysql2date('F Y', $event['date'], true);
echo '<tr><td colspan="5">'.$current_month.'</td></tr>';
} ?>
<tr>
<td><?php echo $event['title']; ?></td>
<td><?php echo mysql2date('D', $event['date'], true); ?></td>
<td><?php echo mysql2date('j. F Y', $event['date'], true); ?></td>
<td><?php echo $event['time']; ?> Uhr</td>
<td><?php echo $event['location']; ?></td>
</tr>
<?php } ?>
</table>