diff options
Diffstat (limited to 'list.php')
-rw-r--r-- | list.php | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -69,10 +69,24 @@ foreach ($events as $event){ $start_date=strtotime ($event['start_date']); $end_date=strtotime ($event['end_date']); + $classes=[]; + $month=date ('m',$start_date); - echo $month==$last_month ? '<tr>' : '<tr class="new-month">'; + if ($month!=$last_month) + $classes[]='new-month'; $last_month=$month; + $time=time(); + if ($end_date<$time) + $classes[]='expired'; + elseif ($start_date<=$time && $time<$end_date+3600*24) + $classes[]='current'; + + if (count ($classes)) + echo '<tr class="'.implode (' ',$classes).'">'; + else + echo '<tr>'; + echo '<td>'.format_date_range ($start_date,$end_date).'</td>'; echo '<td>'.htmlspecialchars ($event['location']).'</td>'; echo '<td class="large"><span class="title-link" title="Click for details" onclick="expand_or_collapse(this,'.$event['id'].');">'.htmlspecialchars ($event['title']).'</span></td>'; |