Mon | Tue | Wed | Thu | Fri | Sat | Sun | {% else %}Sun | Mon | Tue | Wed | Thu | Fri | Sat | {% endif %}
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{% set day_counter = day_counter + 1 %} {% endfor %} {# Add cells for each day of the month #} {% for day in days_in_month %} {% set day_str = day.strftime('%Y-%m-%d') %} {# Start a new row after every 7 cells #} {% if day_counter % 7 == 0 and day_counter > 0 %} | |||||||||||||
{{ day.strftime('%d') }}
|
{% set day_counter = day_counter + 1 %}
{% endfor %}
{# Add empty cells for days after the last day of the month #}
{% set remaining_cells = 7 - (day_counter % 7) %}
{% if remaining_cells < 7 %}
{% for _ in range(remaining_cells) %}
{% endfor %} {% endif %} |