Explorar o código

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

Improved null handling for dates within list view.
Thomas %!s(int64=14) %!d(string=hai) anos
pai
achega
d9953ebedf
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  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' %}
 
-{% block field%}{{ value|date }}{% endblock %}
-
+{% block field %}
+    {%- if value is empty -%}
+         
+    {%- else -%}
+        {{ value|date }}
+    {%- endif -%}
+{% endblock %}