Skip to content

Commit

Permalink
Update CorrectDateBehavior.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lav45 authored Sep 21, 2023
1 parent f0aa3e2 commit c0697c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/CorrectDateBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -91,4 +92,4 @@ protected function format($value)
return null;
}
}
}
}

0 comments on commit c0697c1

Please sign in to comment.