diff --git a/src/Doctrine/EntityDetails.php b/src/Doctrine/EntityDetails.php index 03fdc27bf..dfd46ba25 100644 --- a/src/Doctrine/EntityDetails.php +++ b/src/Doctrine/EntityDetails.php @@ -61,6 +61,16 @@ public function getFormFields(): array $fieldsWithTypes[$field] = null; } + foreach ($this->metadata->fieldMappings as $fieldName => $fieldMapping) { + $propType = DoctrineHelper::getPropertyTypeForColumn($fieldMapping['type']); + if (($propType === '\\'.\DateTimeImmutable::class) + || ($propType === '\\'.\DateTimeInterface::class)) { + $fieldsWithTypes[$fieldName] = [ + 'type' => null, + 'options_code' => "'widget' => 'single_text'", + ]; + } + } foreach ($this->metadata->associationMappings as $fieldName => $relation) { if (\Doctrine\ORM\Mapping\ClassMetadata::ONE_TO_MANY === $relation['type']) { continue;