Create a connector to synchronize with zimbra calendars

This commit is contained in:
2025-12-05 11:59:32 +00:00
parent 0ba5cd849c
commit 92d5fe154e
34 changed files with 1116 additions and 22 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ZimbraBundle\Calendar\Connector\ZimbraConnector;
use Zimbra\Mail\Struct\DtTimeInfo;
/**
* Class DateConverter.
*
* Provides methods for converting PHP DateTime objects
* into specific date-time formats or representations.
*/
final readonly class DateConverter
{
public const FORMAT_DATE_TIME = 'Ymd\THis';
/**
* Converts a PHP DateTimeInterface object into a Zimbra-specific DtTimeInfo object.
*
* @param \DateTimeInterface $date the date to be converted
*
* @return DtTimeInfo the converted DtTimeInfo object
*/
public function phpToZimbraDateTime(\DateTimeInterface $date): DtTimeInfo
{
return new DtTimeInfo($date->format(self::FORMAT_DATE_TIME), $date->getTimezone()->getName());
}
}