WIP Timesheet REST API: fix PHP Fatal error in Addressbook REST API

Declaration of EGroupware\Api\Contacts\JsContact::UTCDateTime($date) must be compatible with EGroupware\Api\CalDAV\JsBase::UTCDateTime($date, bool $user = false)
This commit is contained in:
ralf 2023-12-01 14:12:21 +02:00
parent 1bec0c94a4
commit 1b85a9dd5b

View File

@ -1067,29 +1067,6 @@ class JsContact extends Api\CalDAV\JsBase
return $value;
}
/**
* Return a date-time value
*
* @link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-jscontact-07#section-1.5.5
* @param null|string|\DateTime $date
* @return string|null
*/
protected static function UTCDateTime($date)
{
static $utc=null;
if (!isset($utc)) $utc = new \DateTimeZone('UTC');
if (!isset($date))
{
return null;
}
$date = Api\DateTime::to($date, 'object');
$date->setTimezone($utc);
// we need to use "Z", not "+00:00"
return substr($date->format(Api\DateTime::RFC3339), 0, -6).'Z';
}
/**
* Get jsCardGroup for given group
*