<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>timezone and recurrence fixes for Kronolith&#039;s scheduler</title> 
  <pubDate>Fri, 10 Apr 2026 17:52:44 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7038</link> 
  <atom:link rel="self" type="application/rss+xml" title="timezone and recurrence fixes for Kronolith&#039;s scheduler" href="https://bugs.horde.org/ticket/7038/rss" /> 
  <description>timezone and recurrence fixes for Kronolith&#039;s scheduler</description> 
 
   
   
  <item> 
   <title>When the server and the Horde users use different timezones </title> 
   <description>When the server and the Horde users use different timezones (in my case, UTC vs. Europe/Berlin), and the Kronolith scheduler is used (instead of the Horde Alarm system), strange things occur. In my case, many events were scheduled twice, once on time and once two hours later (the timezone difference between UTC and Europe/Berlin summer time). There also was an interaction with the agenda code which set the &#039;TZ&#039; environment variable and inadvertantly changed the PHP&#039;s timezone for the following date calculations in the scheduler; as the agenda() function was not called every time, it was close to undeterminable when an event is scheduled correctly and when it is scheduled twice.



So I rewrote the scheduler in the spirit of the agenda function, i.e. I changed the outer and the inner loop of the scheduler: The outer loop iterates on the users, and the inner loop iterates on the events of the shares visible to the user. This allows to set the timezone for each user according to her stored preference before accessing the events.



The second problem the patches fixes is a bug introduced in rev. 1.55 of lib/Scheduler/kronolith.php. As the revision comment correctly says, &quot;Recurrence processing happens in listAlarms() now&quot;, so code was removed which handled recurrences via nextRecurrence() and hasException(). However, listAlarms() is called with fullevent==false, such that only the event *ids* and not the events (with corrected start/end time) are returned. So when the event is later retrieved via getEvent():



$event = $GLOBALS[&#039;kronolith_driver&#039;]-&gt;getEvent($eventId);



the recurrence corrections are gone. My solution simply reactivates the old correction code:



                            /* Set the event&#039;s start date to the next

                             * recurrence date. This should avoid problems

                             * when an alarm triggers on a different day from

                             * the actual event, and make $seenid unique for

                             * each occurrence of a recurring event. */

                            $event-&gt;start = $event-&gt;recurrence-&gt;nextRecurrence($this-&gt;_runtime);



                            /* Check for exceptions; do nothing if one is found. */

                            if ($event-&gt;recurrence-&gt;hasException($event-&gt;start-&gt;year, $event-&gt;start-&gt;month, $event-&gt;start-&gt;mday)) {

                                continue;

                            }



Another solution would be to rewrite this part of scheduler to use fullevent==true and to omit the getEvent() call. I can try that if you think that this would be the better solution.

</description> 
   <pubDate>Sun, 06 Jul 2008 21:01:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7038#t47312</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/kronolith/lib/Scheduler/kronolith.php?r1=1.25.6.21&amp;r2=1.25.6.22&amp;ty=u</description> 
   <pubDate>Tue, 14 Oct 2008 17:17:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7038#t49690</link> 
  </item> 
   
  <item> 
   <title>Tweaked and committed. Please test the version I checked in.</title> 
   <description>Tweaked and committed. Please test the version I checked in.</description> 
   <pubDate>Tue, 14 Oct 2008 17:18:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7038#t49691</link> 
  </item> 
   
  <item> 
   <title>Sorry for my late posting, I&#039;m currently finishing my PhD th</title> 
   <description>Sorry for my late posting, I&#039;m currently finishing my PhD thesis and there&#039;s quite a lot to do yet... Anyway, your fix works for me, thank you!</description> 
   <pubDate>Fri, 24 Oct 2008 07:35:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7038#t49935</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
