Hello!
Does this plugin allow me to use objects within the IPS namespace? I'm hoping to write some custom code that requires their datetime object, but when I try to stick that code in a php block, it errors out the entire page and I have to manually remove the block from the database.
Perhaps I'm doing something wrong? I'm not very familiar with how to import a class into PHP, especially the IPS ones if they allow it. (I really jsut want their client-side timezone conversion)
<?php
require("init.php");
// this block runs fine, but if I remove the die() for the rest, it kills the page.
if ( !defined( '\IPS\DateTime' ) )
{
echo "Something has gone wrong.\n";
echo getcwd();
die(1);
}
// I've clipped out some other code, but it's safe to assume $event exists with these properties
// The code worked fine when I used normal php datetime objects
$eventStart = \IPS\DateTime::createFromFormat(DateTime::ISO8601, (string)$event->startTimeUTC);
$eventEnd = \IPS\DateTime::createFromFormat(DateTime::ISO8601, (string)$event->endTimeUTC);