mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Calendar: Fix week day header for incomplete months
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
{% load i18n %}
|
||||
{% load date_fast %}
|
||||
{% load calendarhead %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-calendar">
|
||||
<caption class="sr-only">{% trans "Calendar" %}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span aria-hidden="true">{{ weeks.1.0.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.0.date|date_fast:"l" }}</span></th>
|
||||
<th><span aria-hidden="true">{{ weeks.1.1.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.1.date|date_fast:"l" }}</span></th>
|
||||
<th><span aria-hidden="true">{{ weeks.1.2.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.2.date|date_fast:"l" }}</span></th>
|
||||
<th><span aria-hidden="true">{{ weeks.1.3.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.3.date|date_fast:"l" }}</span></th>
|
||||
<th><span aria-hidden="true">{{ weeks.1.4.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.4.date|date_fast:"l" }}</span></th>
|
||||
<th><span aria-hidden="true">{{ weeks.1.5.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.5.date|date_fast:"l" }}</span></th>
|
||||
<th><span aria-hidden="true">{{ weeks.1.6.date|date_fast:"D" }}</span><span class="sr-only">{{ weeks.1.6.date|date_fast:"l" }}</span></th>
|
||||
{% for d in weeks|iter_weekdays %}
|
||||
<th><span aria-hidden="true">{{ d|date_fast:"D" }}</span><span class="sr-only">{{ d|date_fast:"l" }}</span></th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -679,6 +679,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
timeout=120,
|
||||
)
|
||||
context['weeks'] = weeks_for_template(ebd, self.year, self.month, future_only=self.request.event.settings.event_calendar_future_only)
|
||||
context['weeks'] = weeks_for_template(ebd, self.year, self.month, future_only=self.request.event.settings.event_calendar_future_only)
|
||||
context['months'] = [date(self.year, i + 1, 1) for i in range(12)]
|
||||
if self.request.event.settings.event_calendar_future_only:
|
||||
context['years'] = range(now().year, now().year + 3)
|
||||
|
||||
Reference in New Issue
Block a user