Browse Source

Add check if the date is null

Thomas Rabaix 13 years ago
parent
commit
d5cacbb7ab
1 changed files with 7 additions and 1 deletions
  1. 7 1
      Resources/views/CRUD/list_date.html.twig

+ 7 - 1
Resources/views/CRUD/list_date.html.twig

@@ -10,4 +10,10 @@ file that was distributed with this source code.
 #}
 {% extends 'SonataAdminBundle:CRUD:list_integer.html.twig' %}
 
-{% block field%}{{ value|date('F j, Y') }}{% endblock %}
+{% block field%}
+    {%- if value is empty -%}
+         
+    {%- else -%}
+        {{ value|date('F j, Y') }}
+    {%- endif -%}
+{% endblock %}