projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
f96d8d8
)
Added Capability to format DateInterval via twig date filter
author
phiamo
<phiamo@gmail.com>
Thu, 29 Sep 2011 00:44:55 +0000 (
02:44
+0200)
committer
phiamo
<phiamo@gmail.com>
Thu, 29 Sep 2011 00:44:55 +0000 (
02:44
+0200)
lib/Twig/Extension/Core.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Extension/Core.php
b/lib/Twig/Extension/Core.php
index
8265394
..
6ca8331
100644
(file)
--- 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()));