[Tickets #12843] Re: Wrong timezone calculation with CalDAV

noreply at bugs.horde.org noreply at bugs.horde.org
Thu Feb 6 05:44:04 UTC 2014


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/12843
------------------------------------------------------------------------------
  Ticket             | 12843
  Updated By         | info at individual-it.net
  Summary            | Wrong timezone calculation with CalDAV
  Queue              | Kronolith
  Version            | 4.1.4
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
+New Attachment     | berlin 10.ics
------------------------------------------------------------------------------


info at individual-it.net (2014-02-06 05:44) wrote:

I've installed 5.1.6-git and tried to dig deeper into that problem.
Here is what I got:

I'm importing the attached ics. That's the way lighning sends its data.
The main data is:
DTSTART;TZID=Europe/Berlin:20140205T100000
DTEND;TZID=Europe/Berlin:20140205T110000

So here what happends in the code
In framework/Icalendar/lib/Horde/Icalendar.php line 1296
$time = $this->_parseTime($dateParts[1])
is called
it gets $dateParts[1] what has the correct value of 100000
and it returns:
$time	Array [4]
	hour	10
	minute	00
	second	00
	zone	Local

In the next lines $this->_parseTZID($date, $time, $tzid) is called
that returns
$tzoffset	3600

That offset is substracted from the calculated time, what gives us the  
correct time in UTC

But when we came back to line 681 In  
framework/Icalendar/lib/Horde/Icalendar.php and set the attribute with
$this->setAttribute($tag, $this->_parseDateTime($ts[0], $tzid), $params);

We end up with an Object that looks like:

$this	Horde_Icalendar_Vevent
	CLASSNAME	Horde_Icalendar_Vevent
	type	vEvent
	_container	Horde_Icalendar
	_attributes	Array [7]
		0	Array [4]
		1	Array [4]
		2	Array [4]
		3	Array [4]
		4	Array [4]
		5	Array [4]
			name	DTSTART
			params	Array [1]
				TZID	Europe/Berlin
			value	1391590800
			values	Array [1]
		6	Array [4]
	_components	Array [0]
	_newline
	_version	2.0
	_oldFormat	false

So we have the time in UTC but TZID set to Europe/Berlin
That object get passed back the whole way to kronolith/data.php line 90
$next_step = $data->nextStep($actionID, $param);

So in the database I end up with and event that looks like:
event_start 	2014-02-05 08:00:00
event_end  2014-02-05 08:59:59
event_timezone Europe/Berlin

It looks like before the event get saved it get coonverted to UTC again
That's with
$conf['calendar']['params']['utc'] = true;
$conf['resource']['params']['utc'] = true;

If I set both values to false I end up in the database with:
event_start 	2014-02-05 09:00:00
event_end  2014-02-05 09:59:59
event_timezone Europe/Berlin

So my quick fix is simple to disable the $tzoffset calculation. and  
set it to false. (I know this is not really a fix of the problem)
Without that fix I can just add events correctly from lightning that  
are in the same  timezone as set in horde under  Global Preferences ->  
Local and Time
With that fix other timezones also work fine.

So far for now, will dig deeper.


Another problem is that the webinterface of kronolith seems to show  
all events according to UTC, no matter what is set in the settings.  
But I think that is not related.




info at individual-it.net (2014-02-06 05:44) uploaded: berlin 10.ics

http://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=berlin%2010.ics&ticket=12843&fn=%2Fberlin%2010.ics





More information about the bugs mailing list