Skip to content

Commit

Permalink
Merge branch '5.23' into 5.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidmattei committed Dec 5, 2024
2 parents 0ccb281 + 1f5f4c6 commit fe4102a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions EMS/core-bundle/src/Form/DataField/TimeFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fe4102a

Please sign in to comment.