<?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>isAllDay() has wrong test?</title> 
  <pubDate>Fri, 10 Apr 2026 01:27:10 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/8191</link> 
  <atom:link rel="self" type="application/rss+xml" title="isAllDay() has wrong test?" href="https://bugs.horde.org/ticket/8191/rss" /> 
  <description>isAllDay() has wrong test?</description> 
 
   
   
  <item> 
   <title>I&#039;m running into what I believe is a bug in the display of n</title> 
   <description>I&#039;m running into what I believe is a bug in the display of non-recurring all day events.  I have the following event:



SELECT event_title, event_recurtype, event_start, event_end

 FROM kronolith_events WHERE event_id = &#039;eed64d52188a4a4732607fa1f12f812a&#039;\G

*************************** 1. row ***************************              

    event_title: all day                                                    

event_recurtype: 0                                                          

    event_start: 2009-04-09 00:00:00                                        

      event_end: 2009-04-10 00:00:00                                        



According to the logic in isAllDay() in Driver.php lines 1703-1711, that should be an all day event:                                   



function isAllDay()

{                  

    return ($this-&gt;start-&gt;hour == 0 &amp;&amp; $this-&gt;start-&gt;min == 0 &amp;&amp; $this-&gt;start-&gt;sec == 0 &amp;&amp;

            (($this-&gt;end-&gt;hour == 0 &amp;&amp; $this-&gt;end-&gt;min == 0 &amp;&amp; $this-&gt;end-&gt;sec == 0) ||   

             ($this-&gt;end-&gt;hour == 23 &amp;&amp; $this-&gt;end-&gt;min == 59)) &amp;&amp;                        

            ($this-&gt;end-&gt;mday &gt; $this-&gt;start-&gt;mday ||                                     

             $this-&gt;end-&gt;month &gt; $this-&gt;start-&gt;month ||                                   

             $this-&gt;end-&gt;year &gt; $this-&gt;start-&gt;year));                                     

}                                                                                         



The start and end hour, minute, and second are all 0; and the end mday is greater than the start mday.



Unfortunately, by the time isAllDay() is called on this event, the end mday has been changed by code in Kronolith.php:



/* If the event doesn&#039;t end at 12am set the end date to the

 * current end date. If it ends at 12am and does not end at

 * the same time that it starts (0 duration), set the end date

 * to the previous day&#039;s end date. */                         

if ($event-&gt;end-&gt;hour != 0 ||                                 

    $event-&gt;end-&gt;min != 0 ||                                  

    $event-&gt;end-&gt;sec != 0 ||                                  

    $event-&gt;start-&gt;compareDateTime($event-&gt;end) == 0 ||       

    $event-&gt;isAllDay()) {                                     

    $eventEnd = Util::cloneObject($event-&gt;end);               

} else {                                                      

    $eventEnd = new Horde_Date(                               

        array(&#039;hour&#039; =&gt;  23,                                  

              &#039;min&#039; =&gt;   59,

              &#039;sec&#039; =&gt;   59,

              &#039;month&#039; =&gt; $event-&gt;end-&gt;month,

              &#039;mday&#039; =&gt;  $event-&gt;end-&gt;mday - 1,

              &#039;year&#039; =&gt;  $event-&gt;end-&gt;year));

}



Consequently, when isAllDay() is called, the end mday is no longer greater than the start mday, and this event is _not_ displayed as an all-day event, but rather as an event that lasts pretty much all of

the day.



I *think* that the fix will be to change the logic in inAllDay() to this:



return ($this-&gt;start-&gt;hour == 0 &amp;&amp; $this-&gt;start-&gt;min == 0 &amp;&amp; $this-&gt;start-&gt;sec == 0 &amp;&amp;

       (($this-&gt;end-&gt;hour == 0 &amp;&amp; $this-&gt;end-&gt;min == 0 &amp;&amp; $this-&gt;end-&gt;sec == 0 &amp;&amp;

         ($this-&gt;end-&gt;mday &gt; $this-&gt;start-&gt;mday ||

          $this-&gt;end-&gt;month &gt; $this-&gt;start-&gt;month ||

          $this-&gt;end-&gt;year &gt; $this-&gt;start-&gt;year)) ||

        ($this-&gt;end-&gt;hour == 23 &amp;&amp; $this-&gt;end-&gt;min == 59 &amp;&amp; $this-&gt;end-&gt;sec == 59)));



The old logic tested for (start is 00:00:00) and (end is 00:00:00 or 23:59) and (end day is after start day).  This revised logic tests for (start is 00:00:00) and (end is 23:59:59 or (end is 00:00:00 and end day is after start day)).



I&#039;m not entirely sure that that&#039;s the right thing, though.</description> 
   <pubDate>Tue, 14 Apr 2009 13:20:24 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8191#t53647</link> 
  </item> 
   
  <item> 
   <title>Sorry, just realized this was a duplicate of 8176; when I fi</title> 
   <description>Sorry, just realized this was a duplicate of 8176; when I first tried submitting this ticket, bugs.horde.org was being wonky and I didn&#039;t think it went through.</description> 
   <pubDate>Tue, 14 Apr 2009 13:22:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8191#t53648</link> 
  </item> 
   
  <item> 
   <title>Bug: 8176</title> 
   <description>Bug: 8176</description> 
   <pubDate>Thu, 16 Apr 2009 21:50:48 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8191#t53693</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
