Fix date() usage

This commit is contained in:
Raphael Michel
2020-10-06 12:50:37 +02:00
parent d7459b3b83
commit d392e14a96
2 changed files with 2 additions and 2 deletions

View File

@@ -467,7 +467,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
context['days'] = days_for_template(ebd, week)
context['weeks'] = [
(date.fromisocalendar(self.year, i + 1, 1), date.fromisocalendar(self.year, i + 1, 7))
for i in range(53 if date(self.year, 12, 31)[0] == self.year else 52)
for i in range(53 if date(self.year, 12, 31).isocalendar()[0] == self.year else 52)
]
context['years'] = range(now().year - 2, now().year + 3)
context['week_format'] = get_format('WEEK_FORMAT')

View File

@@ -524,7 +524,7 @@ class WeekCalendarView(OrganizerViewMixin, EventListMixin, TemplateView):
ctx['days'] = days_for_template(ebd, week)
ctx['weeks'] = [
(date.fromisocalendar(self.year, i + 1, 1), date.fromisocalendar(self.year, i + 1, 7))
for i in range(53 if date(self.year, 12, 31)[0] == self.year else 52)
for i in range(53 if date(self.year, 12, 31).isocalendar()[0] == self.year else 52)
]
ctx['years'] = range(now().year - 2, now().year + 3)
ctx['week_format'] = get_format('WEEK_FORMAT')