Le 13/05/2011 12:25, Sylvain > Com-Océan a écrit :
Hi,
I have a date field for an object (a doctrine entity) which can be empty.
When I display this field with a date filter on an empty date, I got
11/30/-0001
{{ project.deadline|date("m/d/Y") }}
# display : 11/30/-0001
Maybe this can be fix in Twig (?).
But even it is normal, how can I test if date value is empty or null
with twig ?
I test the following code but it change nothing :
{% if project.deadline %}
{{ project.deadline|date("m/d/Y") }}
{% endif %}
Thanks a lot !
I have other questions about Symfony2 on the forum :
Question about UserBundle and Doctrine2 ORM
<http://forum.symfony-project.org/viewtopic.php?f=23&t=35274>
Question about doctrine:generate:entities
<http://forum.symfony-project.org/viewtopic.php?f=23&t=35273>
Best practice for filter form
<http://forum.symfony-project.org/viewtopic.php?f=23&t=35179>
Use/{% if project.deadline is defined %}/
--
Christophe | Stof
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en