[kronolith] recurring events without an end date

jeremy at ossnetworks.org jeremy at ossnetworks.org
Sun Feb 23 18:31:02 PST 2003



Hi,

I noticed that recurring events without an
end date did not work properly upon installation.
It seems this issue should effect installation on
every 32 bit platform for every backend.  The problem
is on lines 354-358 in kronolith/lib/Event.php:

if (Horde::getFormData('recur_enddate_type') == 'none') {
                $recur_enddate_year = 9999;
                $recur_enddate_month = 12;
                $recur_enddate_day = 31;
            } else {

The problem here is with the php function mktime.  The
idea seems to have been to hard code a date far away
in year 9999, so the events have an end date but its beyond
our lifetimes.  That's ok enough, but we have an integer size
problem.

===========================================================

Quoting a post to the php documentation tipping me off
to why my Postgres database had default system times:

This is great!  However, there is one thing you may want to take note
of...namely INTEGER limitations.  Apparently the mktime() function returns the
UNIX time conversion of a date where the values represent seconds since Jan 1,
1970, and are positive or negative depending on whether the date appears before
or after 1970.  Due to the MAX_INT (LONG?) size, dates can only be represented
as far back as 1902 (- MAX) and as far forward as 2037 (+ MAX).

Also, the addition of any field that might exceed the max_int limitation itself
will cause an invalid calculation and reset the date to Dec 31, 1969 (Unix time
of -1).

===========================================================

So my solution was to change the year to 2037 which made everything
happy.  Is there some reason this has not affected a
everyone else's install?  This seems like a simple quick fix
we should integrate to the stable tree.

I also noticed that Kronolith is not listed under the bug 
reports section for Horde with the other projects.  Should
we be tracking these there?

Thanks for taking a look,

Jeremy



More information about the kronolith mailing list