6.0.0-beta1
8/23/25

[#1822] Kolab: problem handling events having no time associated
Summary Kolab: problem handling events having no time associated
Queue Kronolith
Queue Version HEAD
Type Bug
State Resolved
Priority 2. Medium
Owners stuart (at)
Requester a.gungl (at) gmx (dot) de
Created 04/19/2005 (7431 days ago)
Due
Updated 06/07/2005 (7382 days ago)
Assigned 04/19/2005 (7431 days ago)
Resolved 06/07/2005 (7382 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/07/2005 09:34:53 AM stuart Comment #6
State ⇒ Resolved
Reply to this comment
Thanks for the patch, Andreas - I've just committed it.
06/02/2005 03:12:24 PM a (dot) gungl (at) gmx (dot) de Comment #5
New Attachment: all-day-events-with-Kolab.diff Download
Reply to this comment
Hi, here is a patch which solves the problem. Please apply ASAP.
04/29/2005 07:51:41 PM a (dot) gungl (at) gmx (dot) de Comment #4 Reply to this comment
Hi Horde team, can anyone outline possible solutions for the timezone 
problem? I'm willing to test some variants, otherwise you can't use 
Horde if you don't use GMT / UTC.

Regards,

Andreas
04/20/2005 03:12:40 PM a (dot) gungl (at) gmx (dot) de Comment #3 Reply to this comment
I've tried mktime, but without success: What I have found in the 
meantime is the need to fix kronolith/lib/Driver/kolab.php in function 
saveEvent($event) around line 180 like this:



         $k->setVal('alarm', $event->getAlarm());

         if ($event->isAllDay()) {

             $k->setVal('start-date', 
Kolab::encodeDate($event->start->timestamp()));

             $k->setVal('end-date', 
Kolab::encodeDate($event->end->timestamp()));

         } else {

             $k->setVal('start-date', 
Kolab::encodeDateTime($event->start->timestamp()));

             $k->setVal('end-date', 
Kolab::encodeDateTime($event->end->timestamp()));

         }



         switch ($event->status) {



This is because the Kolab XML format expects date-only values for 
events with a duration of a whole day.



However this increases the timezone problem. In function 
encodeDate($date = false) in framework/Kolab/kolab.php there I find 
time values like 2005-04-20T22:00:00Z for GMT+2 midnight, but this is 
2005-04-21 (00:00) in our time. Reducing the values 
2005-04-20T22:00:00Z and 2005-04-21T22:00:00Z to the date gives 
2005-04-20 and 2005-04-21 instead of 2005-04-21 two times. :-(

So I end up with a two day long event instead of one day.


04/19/2005 04:39:45 PM Jan Schneider Comment #2
Assigned to stuart
State ⇒ Assigned
Reply to this comment
A possible solution would be to use mktime() instead of gmmktime(), 
but this method might be used in different places where we explicitely 
expect GMT dates. Stuart, you probably know this off your head.
04/19/2005 04:28:40 PM a (dot) gungl (at) gmx (dot) de Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Kolab: problem handling events having no time associated
Queue ⇒ Kronolith
Reply to this comment
There is a problem in the Kolab class in:

     function decodeDate($date)

     {

         if (empty($date)) {

             return 0;

         }



         list($year, $month, $day) = explode('-', $date);

         return gmmktime(0, 0, 0, $month, $day, $year);

     }



The problem is that assuming "0, 0, 0" as midnight is wrong here. The 
events created by other Kolab 2 clients having entries like 
<start-date>2005-04-22</start-date> show up from 2am to 2am at the 
next day due to our GMT+2 (daylight saving) timezone.

Saved Queries