add validation on calendar

This commit is contained in:
2022-07-01 15:05:03 +02:00
parent 9c1324e9ec
commit 93c5e83454
4 changed files with 23 additions and 7 deletions

View File

@@ -101,7 +101,7 @@ class CalendarType extends AbstractType
return $res;
},
static function (?string $dateAsString): ?DateTimeImmutable {
if ('' === $dateAsString) {
if ('' === $dateAsString || null === $dateAsString) {
return null;
}
@@ -122,7 +122,7 @@ class CalendarType extends AbstractType
return $res;
},
static function (?string $dateAsString): ?DateTimeImmutable {
if ('' === $dateAsString) {
if ('' === $dateAsString || null === $dateAsString) {
return null;
}