diff --git a/Classes/ViewHelpers/RenderValuesViewHelper.php b/Classes/ViewHelpers/RenderValuesViewHelper.php index 7bb9462..7dabda2 100644 --- a/Classes/ViewHelpers/RenderValuesViewHelper.php +++ b/Classes/ViewHelpers/RenderValuesViewHelper.php @@ -96,6 +96,9 @@ public function render(): string */ protected function processElementValue(FormElementInterface $element, $value) { + if (is_object($value)) { + return $this->processObject($element, $value); + } $properties = $element->getProperties(); if (isset($properties['options']) && is_array($properties['options'])) { if (is_array($value)) { @@ -104,9 +107,6 @@ protected function processElementValue(FormElementInterface $element, $value) return $this->mapValueToOption($value, $properties['options']); } - if (is_object($value)) { - return $this->processObject($element, $value); - } return $value; } @@ -151,14 +151,14 @@ protected function mapValueToOption($value, array $options): string protected function processObject(FormElementInterface $element, $object): string { $properties = $element->getProperties(); - if ($object instanceof \DateTime) { + if ($object instanceof \DateTimeInterface) { if (isset($properties['dateFormat'])) { $dateFormat = $properties['dateFormat']; if (isset($properties['displayTimeSelector']) && $properties['displayTimeSelector'] === true) { $dateFormat .= ' H:i'; } } else { - $dateFormat = \DateTime::W3C; + $dateFormat = \DateTimeInterface::W3C; } return $object->format($dateFormat); }