mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-10 22:28:23 +00:00
create event by selecting a calendar range
This commit is contained in:
@@ -91,15 +91,19 @@ class CalendarType extends AbstractType
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
static function (?DateTimeImmutable $dateTimeImmutable): string {
|
||||
if (null !== $dateTimeImmutable) {
|
||||
$res = date_format($dateTimeImmutable, 'Y-m-d H:i:s');
|
||||
$res = date_format($dateTimeImmutable, DateTimeImmutable::ATOM);
|
||||
} else {
|
||||
$res = '';
|
||||
}
|
||||
|
||||
return $res;
|
||||
},
|
||||
static function (?string $dateAsString): DateTimeImmutable {
|
||||
return new DateTimeImmutable($dateAsString);
|
||||
static function (?string $dateAsString): ?DateTimeImmutable {
|
||||
if ('' === $dateAsString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DateTimeImmutable::createFromFormat(DateTimeImmutable::ATOM, $dateAsString);
|
||||
}
|
||||
));
|
||||
|
||||
@@ -108,15 +112,19 @@ class CalendarType extends AbstractType
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
static function (?DateTimeImmutable $dateTimeImmutable): string {
|
||||
if (null !== $dateTimeImmutable) {
|
||||
$res = date_format($dateTimeImmutable, 'Y-m-d H:i:s');
|
||||
$res = date_format($dateTimeImmutable, DateTimeImmutable::ATOM);
|
||||
} else {
|
||||
$res = '';
|
||||
}
|
||||
|
||||
return $res;
|
||||
},
|
||||
static function (?string $dateAsString): DateTimeImmutable {
|
||||
return new DateTimeImmutable($dateAsString);
|
||||
static function (?string $dateAsString): ?DateTimeImmutable {
|
||||
if ('' === $dateAsString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DateTimeImmutable::createFromFormat(DateTimeImmutable::ATOM, $dateAsString);
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user