list_datetime.html.twig 799 B

12345678910111213141516171819202122232425
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% extends admin.getTemplate('base_list_field') %}
  8. {% block field %}
  9. {%- if value is empty -%}
  10. &nbsp;
  11. {%- elseif field_description.options.format is defined -%}
  12. {% set timezone = field_description.options.timezone is defined ? field_description.options.timezone : null %}
  13. {{ value|date(field_description.options.format, timezone) }}
  14. {%- elseif field_description.options.timezone is defined -%}
  15. {{ value|date(null, field_description.options.timezone) }}
  16. {%- else -%}
  17. {{ value|date }}
  18. {%- endif -%}
  19. {% endblock %}