[kronolith] DateTime types in xml_rpc

Matthew Sackman matthew at sackman.co.uk
Sat Apr 19 21:28:48 PDT 2003


On Sat, Apr 19, 2003 at 05:43:24PM +0100, Matthew Sackman wrote:
> On Sat, Apr 19, 2003 at 05:53:06PM +0200, Jan Schneider wrote:
> > Zitat von Matthew Sackman <matthew at sackman.co.uk>:
> > > I'm trying to use the calendar.list function which takes startTime,
> > > endTime, an array of calendars to check and the recurrance boolean. How
> > > do I express the start and end dates? I'm using the dateTime.iso8601
> > > format but it really isn't working:
> > 
> > It takes epoch timestamps iirc.
> 
> But it doesn't produce any results (it should - there are events in the
> calendar that should be reported back). Also, if I modify the function
> listEvents in kronolith/lib/Kronolith.php to include
> echo $startDate->year;
> then there is no additional output. If I just echo $startDate then I get
> the raw value out which must indicate that the date object(?) is not
> being constructed. Thus the following code can't possibly work as
> ->year, ->month, ->mday are returning nulls:
> [blah blah blah]

Well I've managed to hack it to work.
In kronolith/lib/api.php in function _kronolith_list, add in:
    @define('KRONOLITH_BASE', dirname(__FILE__) . '/..');
    require_once KRONOLITH_BASE . '/lib/base.php';

Then, after the checks for the $startDate and $endDate, simply add:
    $startDate = Kronolith::timestampToObject($startDate);
    $endDate = Kronolith::timestampToObject($endDate);

So that allows one to supply the timestamps and indeed it does work.
I've no idea what else that breaks though... ;)

Matthew
-- 
Matthew Sackman

BOFH excuse #447:
According to Microsoft, it's by design


More information about the kronolith mailing list