mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 03:46:39 +00:00
5e591ec17df79fcde8ab451be2810d0d2c7c06fc
This PR was merged into the 1.16-dev branch.
Discussion
----------
Fixed the date filter's timezone not being set correctly with strings
When the date filter is used on a string and the timezone argument is specified, the timezone is ignored because of this :
$date = new DateTime($date, $defaultTimezone);
if (false !== $timezone) {
$date->setTimezone($defaultTimezone);
}
Since the date is initialized with `$defaultTimezone` as its timezone, using `$date->setTimezone($defaultTimezone);` has no effect, and the date is displayed without changes since it is considered to already be from this timezone.
Might fix issue #1340
Commits
-------
44aaa5b Fixed the date filter's timezone not being set correctly with strings
Twig, the flexible, fast, and secure template language for PHP ============================================================== Twig is a template language for PHP, released under the new BSD license (code and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. More Information ---------------- Read the `documentation`_ for more information. .. _documentation: http://twig.sensiolabs.org/documentation
Description
Languages
PHP
99.9%