User tests: Successful: Unsuccessful:
This will introduce a user params functionality. Currently only two parameters are supported:
Notice that a new global template variable is introduced - offset. This will allow to modify dates accordingly. The global lang template variable now contains a user's language param.
Please note that params are applied only after re-login.
user-params branchTwig does not apply the timezone. For now I can't find why. For example this does not work:
activity.created_date|date("j M y H:i", offset)
But this works:
"now"|date("j M y H:i", offset)
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-02-15 01:59:53 |
Oh I did notice the check method earlier. And what are your thoughts about the timezone - why it's not working?
According to the documentation it should work as you tried - A bug ?
Does it make sense to convert the time to the users time zone here ?
Right now it is live at
http://ia.dougransom.com/ias
while i test.
On 2014-02-15, at 12:16 PM, Nikolai Plath notifications@github.com wrote:
According to the documentation it should work as you tried - A bug ?
Does it make sense to convert the time to the users time zone here ?—
Reply to this email directly or view it on GitHub.
Doug Ransom
May be a bug, but I'm not sure. Converting tz for me does make sense :)
So I tested:
{{ user.params.timezone }}<br />
{{ activity.created_date }}<br />
{{ activity.created_date|date("j M y H:i") }}<br />
{{ activity.created_date|date("j M y H:i", false) }}<br />
{{ activity.created_date|date("j M y H:i", user.params.timezone) }}<br />
{{ activity.created_date|date("j M y H:i", "GMT") }}<br />
{{ activity.created_date|date("j M y H:i", "Europe/Paris") }}<br />
{{ activity.created_date|date("j M y H:i", "Africa/Cairo") }}<br />
{{ '2012-10-07 14:52:21'|date("j M y H:i", user.params.timezone) }}<br />
{{ '2012-10-07 14:52:21'|date("j M y H:i", "GMT") }}<br />
{{ '2012-10-07 14:52:21'|date("j M y H:i", "Europe/Paris") }}<br />
{{ '2012-10-07 14:52:21'|date("j M y H:i", "Africa/Cairo") }}<br />
{{ 'now'|date("j M y H:i", user.params.timezone) }}<br />
{{ 'now'|date("j M y H:i", "GMT") }}<br />
{{ 'now'|date("j M y H:i", "Europe/Paris") }}<br />
{{ 'now'|date("j M y H:i", "Africa/Cairo") }}<br />
Result:
America/Guayaquil
2014-02-02 21:17:25
2 Feb 14 21:17
2 Feb 14 21:17
2 Feb 14 21:17
2 Feb 14 21:17
2 Feb 14 21:17
2 Feb 14 21:17
7 Oct 12 14:52
7 Oct 12 14:52
7 Oct 12 14:52
7 Oct 12 14:52
15 Feb 14 16:16
15 Feb 14 21:16
15 Feb 14 22:16
15 Feb 14 23:16
Looks like a bug to me...
It doesn't work, as twig can't guess what timezone to calculate from. Your string "2012-10-07 14:52:21" was many moments on that day. If you define a timezone with your sting it works:
{# Base time as UNIX timestamp #}
{{ "@1349614341"|date("j M y H:i", "America/Guayaquil") }}<br />
{{ "@1349614341"|date("j M y H:i", "Europe/Paris") }}<br /><br />
{# Base time in UTC+2 timezone #}
{{ "2012-10-07 14:52:21 +0200"|date("j M y H:i", "America/Guayaquil") }}<br />
{{ "2012-10-07 14:52:21 +0200"|date("j M y H:i", "Europe/Paris") }}<br /><br />
The Travis failure is due to the recent changes in the framework packages.
I merged it anyway