Explorar o código

Add check if the date is null

Thomas Rabaix %!s(int64=13) %!d(string=hai) anos
pai
achega
d5cacbb7ab
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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 %}