Browse Source

Add check if the date is null

Thomas Rabaix 13 năm trước cách đây
mục cha
commit
d5cacbb7ab
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  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 %}