diff --git a/EMS/core-bundle/src/Form/DataField/TimeFieldType.php b/EMS/core-bundle/src/Form/DataField/TimeFieldType.php index 657b3f865..5662aedcb 100644 --- a/EMS/core-bundle/src/Form/DataField/TimeFieldType.php +++ b/EMS/core-bundle/src/Form/DataField/TimeFieldType.php @@ -106,8 +106,11 @@ public function reverseViewTransform($data, FieldType $fieldType): DataField { $format = static::getFormat($fieldType->getOptions()); $converted = !\is_array($data) ? \DateTime::createFromFormat($format, \strval($data)) : false; + $convertedFromStoreFormat = !\is_array($data) ? \DateTime::createFromFormat($this::STOREFORMAT, \strval($data)) : false; if ($converted) { $out = $converted->format($this::STOREFORMAT); + } elseif ($convertedFromStoreFormat) { + $out = $convertedFromStoreFormat->format($this::STOREFORMAT); } else { $out = null; }