Fix start and end time calculation of multi-day events (Bug #7799).
authorJan Schneider <jan@horde.org>
Wed, 25 Mar 2009 23:47:33 +0000 (00:47 +0100)
committerJan Schneider <jan@horde.org>
Wed, 25 Mar 2009 23:47:33 +0000 (00:47 +0100)
kronolith/docs/CHANGES
kronolith/lib/Kronolith.php

index 5596c14..8319e75 100644 (file)
@@ -17,6 +17,7 @@ v3.0-git
 v2.3.1-cvs
 ----------
 
+[jan] Fix start and end time calculation of multi-day events (Bug #7799).
 [jan] Wrap URL in calendar information in IE7 (almarin@um.es, Bug #8043).
 [jan] Fix "Date-string has wrong format" error with holidays (Bug #7961).
 [jan] Use improved translation support in Date_Holidays (Bug #7272).
index ab98776..931cabc 100644 (file)
@@ -823,7 +823,7 @@ class Kronolith
                     } else {
                         $addEvent->start = new Horde_Date(array(
                             'hour' => 0, 'min' => 0, 'sec' => 0,
-                            'month' => $eventStart->month, 'mday' => $eventStart->mday, 'year' => $eventStart->year));
+                            'month' => $loopDate->month, 'mday' => $loopDate->mday, 'year' => $loopDate->year));
                     }
 
                     /* If this is the end day, set the end time to the
@@ -833,7 +833,7 @@ class Kronolith
                     } else {
                         $addEvent->end = new Horde_Date(array(
                             'hour' => 23, 'min' => 59, 'sec' => 59,
-                            'month' => $eventEnd->month, 'mday' => $eventEnd->mday, 'year' => $eventEnd->year));
+                            'month' => $loopDate->month, 'mday' => $loopDate->mday, 'year' => $loopDate->year));
                     }
 
                     $results[$loopDate->dateString()][$addEvent->getId()] = $json ? $addEvent->toJSON() : $addEvent;