From 2aa05334e8ca9ad7bb97688ca66796d84f3ceaed Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 4 Jul 2012 15:57:05 +0200 Subject: [PATCH] Fix timestamp-to-DateTime conversion --- plugins/libkolab/lib/kolab_format_event.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php index 2242d837..0f792ebf 100644 --- a/plugins/libkolab/lib/kolab_format_event.php +++ b/plugins/libkolab/lib/kolab_format_event.php @@ -282,8 +282,8 @@ class kolab_format_event extends kolab_format_xcal 'title' => $rec['summary'], 'location' => $rec['location'], 'description' => $rec['body'], - 'start' => new DateTime('@'.$rec['start-date'], self::$timezone), - 'end' => new DateTime('@'.$rec['end-date'], self::$timezone), + 'start' => new DateTime('@'.$rec['start-date']), + 'end' => new DateTime('@'.$rec['end-date']), 'allday' => $allday, 'recurrence' => $rrule, 'alarms' => $alarm_value . $alarm_unit, @@ -295,5 +295,9 @@ class kolab_format_event extends kolab_format_xcal 'sensitivity' => $rec['sensitivity'], 'changed' => $rec['last-modification-date'], ); + + // assign current timezone to event start/end + $this->data['start']->setTimezone(self::$timezone); + $this->data['end']->setTimezone(self::$timezone); } }