From 5fa00942ddb62337a008a1a040e2eabe37215b6d Mon Sep 17 00:00:00 2001 From: phiamo Date: Thu, 29 Sep 2011 02:44:55 +0200 Subject: [PATCH] Added Capability to format DateInterval via twig date filter --- lib/Twig/Extension/Core.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 8265394..6ca8331 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -221,7 +221,7 @@ function twig_cycle($values, $i) */ function twig_date_format_filter($date, $format = 'F j, Y H:i', $timezone = null) { - if (!$date instanceof DateTime) { + if (!$date instanceof DateTime && !$date instanceof DateInterval) { if (ctype_digit((string) $date)) { $date = new DateTime('@'.$date); $date->setTimezone(new DateTimeZone(date_default_timezone_get())); -- 1.7.2.5