Browse Source

Merge pull request #197 from web-dev/null-dates

Improved null handling for dates within list view.
Thomas 14 years ago
parent
commit
d9953ebedf
1 changed files with 7 additions and 2 deletions
  1. 7 2
      Resources/views/CRUD/list_datetime.html.twig

+ 7 - 2
Resources/views/CRUD/list_datetime.html.twig

@@ -11,5 +11,10 @@ file that was distributed with this source code.
 
 
 {% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 {% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 
-{% block field%}{{ value|date }}{% endblock %}
-
+{% block field %}
+    {%- if value is empty -%}
+         
+    {%- else -%}
+        {{ value|date }}
+    {%- endif -%}
+{% endblock %}