Преглед на файлове

custom date and datetime formats in list

Tiago Garcia преди 12 години
родител
ревизия
cfc05696af
променени са 2 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 2 0
      Resources/views/CRUD/list_date.html.twig
  2. 2 0
      Resources/views/CRUD/list_datetime.html.twig

+ 2 - 0
Resources/views/CRUD/list_date.html.twig

@@ -14,6 +14,8 @@ file that was distributed with this source code.
 {% block field%}
     {%- if value is empty -%}
          
+    {%- elseif field_description.options.format is defined -%}
+        {{ value|date(field_description.options.format) }}
     {%- else -%}
         {{ value|date('F j, Y') }}
     {%- endif -%}

+ 2 - 0
Resources/views/CRUD/list_datetime.html.twig

@@ -14,6 +14,8 @@ file that was distributed with this source code.
 {% block field %}
     {%- if value is empty -%}
          
+    {%- elseif field_description.options.format is defined -%}
+        {{ value|date(field_description.options.format) }}
     {%- else -%}
         {{ value|date }}
     {%- endif -%}