Don't change the colour when the date differs only by one day *and*
authorJoey Schulze <joey@infodrom.org>
Thu, 9 Nov 2006 14:35:42 +0000 (14:35 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 9 Nov 2006 14:35:42 +0000 (14:35 +0000)
the event is the same

src/Termine/years.inc

index 3c1bcf2..007e470 100644 (file)
@@ -45,6 +45,7 @@
   $mon = 0;
   $year = (split (/-/, (split (/\|/, (sort (@termine))[0]))[0]))[0];
   $descr = "";
+  $day = 0;
   $color = $layout_color[1];
   foreach $termin (sort (@termine)) {
     @termin = split (/\|/, $termin);
@@ -54,6 +55,7 @@
       if ($mon != 0) {
         print $layout_foot;
        $descr = "";
+       $day = 0;
        $color = $layout_color[1];
        print "<p><hr>" if ($year != $date[0]);
        $year = $date[0];
       printf $layout_month, $month[$date[1]], $date[0];
       $mon = "$date[0]-$date[1]";
     }
-    if ($termin[2] ne $descr) {
+    if ($termin[2] ne $descr || $date[2] != $day+1) {
       $color = $color eq $layout_color[0]?$layout_color[1]:$layout_color[0];
       $descr = $termin[2];
     }
-
+    $day = $date[2];
     if ($termin[4]) {
       $text = sprintf ("<a href=\"%s\">%s</a>", $termin[4], $termin[2]);
     } else {