{% block extends %}
{{ "{% extends '::base.html.twig' %}" }}
{% endblock extends %}

{% block body %}
{{ "{% block body %}" }}
    <h1>{{ entity }}</h1>

    <table class="record_properties">
        <tbody>
        {%- for field, metadata in fields %}

            <tr>
                <th>{{ field|capitalize }}</th>

            {%- if metadata.type in ['date', 'datetime'] %}

                <td>{{ '{{ ' ~ entity_singularized ~ '.' ~ field|replace({'_': ''}) ~ '|date(\'Y-m-d H:i:s\') }}' }}</td>

            {%- else %}

                <td>{{ '{{ ' ~ entity_singularized ~ '.' ~ field|replace({'_': ''}) ~ ' }}' }}</td>

            {%- endif %}

            </tr>

        {%- endfor %}

        </tbody>
    </table>

    {% set hide_edit, hide_delete = false, false %}
    {% include 'crud/views/others/record_actions.html.twig.twig' %}
{{ "{% endblock %}" }}
{% endblock body %}

{% block extends %}
{{ "{% extends '::base.html.twig' %}" }}
{% endblock extends %}

{% block body %}
{{ "{% block body %}" }}
    <h1>{{ entity }}</h1>

    <table class="record_properties">
        <tbody>
        {%- for field, metadata in fields %}

            <tr>
                <th>{{ field|capitalize }}</th>

            {%- if metadata.type in ['date', 'datetime'] %}

                <td>{{ '{% if ' ~ entity_singularized ~ '.' ~ field|replace({'_': ''}) ~ ' %}{{ ' ~ entity_singularized ~ '.' ~ field|replace({'_': ''}) ~ '|date(\'Y-m-d H:i:s\') }}{% endif %}' }}</td>

            {%- else %}

                <td>{{ '{{ ' ~ entity_singularized ~ '.' ~ field|replace({'_': ''}) ~ ' }}' }}</td>

            {%- endif %}

            </tr>

        {%- endfor %}

        </tbody>
    </table>

    {% set hide_edit, hide_delete = false, false %}
    {% include 'crud/views/others/record_actions.html.twig.twig' %}
{{ "{% endblock %}" }}
{% endblock body %}

Make the "show" template check datetime fields before displaying them (as the "index" template already does)
Make the "show" template check datetime fields before displaying them
(as the "index" template already does)
