diff --git a/src/Jasny/Twig/DateExtension.php b/src/Jasny/Twig/DateExtension.php index 5d5fb70..1886ff0 100644 --- a/src/Jasny/Twig/DateExtension.php +++ b/src/Jasny/Twig/DateExtension.php @@ -91,7 +91,7 @@ public function localDate($date, $format=null, $calendar='gregorian') if (!isset($date)) return null; if ($date instanceof \DateTime); - elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $time); + elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); else $date = new \DateTime((string)$date); $calendar = $calendar == 'traditional' ? \IntlDateFormatter::TRADITIONAL : \IntlDateFormatter::GREGORIAN; @@ -114,7 +114,7 @@ public function localTime($date, $format='short', $calendar='gregorian') if (!isset($date)) return null; if ($date instanceof \DateTime); - elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $time); + elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); else $date = new \DateTime((string)$date); $calendar = $calendar == 'traditional' ? \IntlDateFormatter::TRADITIONAL : \IntlDateFormatter::GREGORIAN; @@ -137,7 +137,7 @@ public function localDateTime($date, $format=null, $calendar='gregorian') if (!isset($date)) return null; if ($date instanceof \DateTime); - elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $time); + elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); else $date = new \DateTime((string)$date); $calendar = $calendar == 'traditional' ? \IntlDateFormatter::TRADITIONAL : \IntlDateFormatter::GREGORIAN;