From: Jan Schneider Date: Wed, 14 Apr 2010 14:50:29 +0000 (+0200) Subject: Adjust end time of events that end at midnight for recurring events too. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=bfb31081e533ce58edea895093c9e6a1e13da2ce;p=horde.git Adjust end time of events that end at midnight for recurring events too. --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 617d1225d..12556c306 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -573,6 +573,22 @@ class Kronolith if ($event->recurs() && $showRecurrence) { /* Recurring Event. */ + /* If the event ends at 12am and does not end at the same time + * that it starts (0 duration), set the end date to the previous + * day's end date. */ + if ($event->end->hour == 0 && + $event->end->min == 0 && + $event->end->sec == 0 && + $event->start->compareDateTime($event->end) != 0) { + $event->end = new Horde_Date( + array('hour' => 23, + 'min' => 59, + 'sec' => 59, + 'month' => $event->end->month, + 'mday' => $event->end->mday - 1, + 'year' => $event->end->year)); + } + /* We can't use the event duration here because we might cover a * daylight saving time switch. */ $diff = array($event->end->year - $event->start->year,