From b4ba23cc39a770e0014ab9d1065a397afd7abbcd Mon Sep 17 00:00:00 2001 From: lykciv Date: Mon, 13 Mar 2023 10:26:42 +0100 Subject: [PATCH] Use DateTimeInterface for grid properties --- .../Extension/Formatter/Property/AbstractProperty.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Oro/Bundle/DataGridBundle/Extension/Formatter/Property/AbstractProperty.php b/src/Oro/Bundle/DataGridBundle/Extension/Formatter/Property/AbstractProperty.php index dcc20f3413d..a15652eaada 100644 --- a/src/Oro/Bundle/DataGridBundle/Extension/Formatter/Property/AbstractProperty.php +++ b/src/Oro/Bundle/DataGridBundle/Extension/Formatter/Property/AbstractProperty.php @@ -76,13 +76,13 @@ protected function convertValue($value) switch ($this->getOr(self::FRONTEND_TYPE_KEY)) { case self::TYPE_DATETIME: case self::TYPE_DATE: - if ($value instanceof \DateTime) { - $value = $value->format(\DateTime::ISO8601); + if ($value instanceof \DateTimeInterface) { + $value = $value->format(\DateTimeInterface::ISO8601); } $result = (string)$value; break; case self::TYPE_TIME: - if ($value instanceof \DateTime) { + if ($value instanceof \DateTimeInterface) { $value = $value->format('H:i:s'); } $result = (string)$value;