public function prepareRecurringEventData(array $event = [], array $interval = [], EntityInterface $calendar = null): ?EntityInterface
    {
        $entity = null;

        if (empty($event)) {
            return $entity;
        }

        $entity = $this->newEntity();
        $entity = $this->patchEntity($entity, $event);
        $entity->set('start_date', $interval['start']);
        $entity->set('end_date', $interval['end']);

        $entity->set('start', $entity->get('start_date')->i18nFormat('yyyy-MM-dd HH:mm:ss'));
        $entity->set('end', $entity->get('end_date')->i18nFormat('yyyy-MM-dd HH:mm:ss'));
        $entity->set('id', $event['id']);

        $entity->set('id', $this->setRecurrenceEventId($entity));
        $entity->set('color', $this->Calendars->getColor($calendar));

        return $entity;
    }