{% if test %}
{% endif %} {% set monate = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] %} {% set ns = namespace(last_month=none, last_week=none) %} {% for event in events %} {% set current_month_name = monate[event.Datum.month - 1] %} {% set current_week = event.Datum.isocalendar()[1] %} {# Monatstitel und Tabellen-Start/Ende Logik #} {% if current_month_name != ns.last_month %} {% if ns.last_month is not none %} {% endif %}
{{ current_month_name }}
{% set ns.last_week = none %} {# Reset Wochendistanz bei neuem Monat #} {% endif %} {# Wochen-Abstand innerhalb eines Monats #} {% if ns.last_week is not none and current_week != ns.last_week %} {% endif %} {% if not event.Morgen and not event.Nachmittag %} {% else %} {% endif %} {% set ns.last_month = current_month_name %} {% set ns.last_week = current_week %} {% endfor %}
{{ event.Wochentag }}. {{ event.Datum.strftime('%d.%m.') }}geschlossen{{ event.Morgen }} {{ event.Nachmittag }}
{% if remarks %}
{% for r in remarks %}
{{ r | safe }}
{% endfor %}
{% endif %} {% if test %}
{% endif %}