소스 검색

Add check if the date is null

Thomas Rabaix 13 년 전
부모
커밋
d5cacbb7ab
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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 %}