From c0697c1e68b87262abc71fb35e405743687c316a Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 21 Sep 2023 12:29:05 +0300 Subject: [PATCH] Update CorrectDateBehavior.php --- src/CorrectDateBehavior.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CorrectDateBehavior.php b/src/CorrectDateBehavior.php index c0ab420..57f0418 100644 --- a/src/CorrectDateBehavior.php +++ b/src/CorrectDateBehavior.php @@ -56,7 +56,8 @@ private function getFormatter() */ public function getAttribute($name) { - if ($value = $this->owner->{$this->attributes[$name]}) { + $value = $this->owner->{$this->attributes[$name]}; + if (is_numeric($value)) { return $this->getFormatter()->format($value, $this->format); } return null; @@ -91,4 +92,4 @@ protected function format($value) return null; } } -} \ No newline at end of file +}