Browse Source

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

Improved null handling for dates within list view.
Thomas 14 năm trước cách đây
mục cha
commit
d9953ebedf
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  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 %}