I'm passing a DateTime object from php to twig, and when calling it on my twig:
{% verbatim %} {{ user.updatedAt }} {% endverbatim %}
I'm getting this output on my page:
{"date":"2017-02-08 18:53:22.000000","timezone_type":3,"timezone":"Europe/Lisbon"}
When I try to apply the filter date("H:i")
on this variable, it's not applied and I get this on the page:
{{ user.updatedAt|date("H:i") }}
In this case, I also have the following angularjs error in the console, which I think is related:
Error: [$parse:syntax] Syntax Error: Token '(' is an unexpected token at column 24 of the expression [ user.updatedAt|date("H:i") ] starting at [("H:i") ].
Can anyone explain to me what's going on? How can I fix this?
Thanks in advance. Cheers