Explorar el Código

Add check if the date is null

Thomas Rabaix hace 13 años
padre
commit
d5cacbb7ab
Se han modificado 1 ficheros con 7 adiciones y 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 %}