projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
1b32617
)
Support of negative timestamps
author
Andrei Shevchuk
<andrei@shvchk.com>
Sun, 20 Nov 2011 09:08:58 +0000 (13:08 +0400)
committer
Andrei Shevchuk
<andrei@shvchk.com>
Sun, 20 Nov 2011 09:08:58 +0000 (13:08 +0400)
lib/Twig/Extension/Core.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Extension/Core.php
b/lib/Twig/Extension/Core.php
index
27f20a9
..
88f545b
100644
(file)
--- a/
lib/Twig/Extension/Core.php
+++ b/
lib/Twig/Extension/Core.php
@@
-237,7
+237,10
@@
function twig_cycle($values, $i)
function twig_date_format_filter($date, $format = 'F j, Y H:i', $timezone = null)
{
if (!$date instanceof DateTime && !$date instanceof DateInterval) {
- if (ctype_digit((string) $date)) {
+ if (ctype_digit((string) $date)
+ || (('-' == $date[0])
+ && (ctype_digit(substr($date, 1))))
+ ) {
$date = new DateTime('@'.$date);
$date->setTimezone(new DateTimeZone(date_default_timezone_get()));
} else {