How can I compare two dates in Twig when the first one comes from the dababase and the second is clear - 2012-12-31? I tried with
{% if dom.dueDate|date('Y-m-d') > 2012-12-31 %}
but I don't get the result I want. :(
I have a DateTime field but I couldn't find a filter for DateTime in Twig and when I use
|date('Y-m-d')
it prints only the date without the hour :(
如果有人能帮我解决问题,我会非常高兴和感激!
{% if 'now'|date('U') > '2013-12-20'|date('U') and 'now'|date('U') < '2014-01-09'|date('U') %}
:-) - Alexey B.