forked from CGM_Public/pretix_original
Fix date() usage
This commit is contained in:
@@ -467,7 +467,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
|||||||
context['days'] = days_for_template(ebd, week)
|
context['days'] = days_for_template(ebd, week)
|
||||||
context['weeks'] = [
|
context['weeks'] = [
|
||||||
(date.fromisocalendar(self.year, i + 1, 1), date.fromisocalendar(self.year, i + 1, 7))
|
(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['years'] = range(now().year - 2, now().year + 3)
|
||||||
context['week_format'] = get_format('WEEK_FORMAT')
|
context['week_format'] = get_format('WEEK_FORMAT')
|
||||||
|
|||||||
@@ -524,7 +524,7 @@ class WeekCalendarView(OrganizerViewMixin, EventListMixin, TemplateView):
|
|||||||
ctx['days'] = days_for_template(ebd, week)
|
ctx['days'] = days_for_template(ebd, week)
|
||||||
ctx['weeks'] = [
|
ctx['weeks'] = [
|
||||||
(date.fromisocalendar(self.year, i + 1, 1), date.fromisocalendar(self.year, i + 1, 7))
|
(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['years'] = range(now().year - 2, now().year + 3)
|
||||||
ctx['week_format'] = get_format('WEEK_FORMAT')
|
ctx['week_format'] = get_format('WEEK_FORMAT')
|
||||||
|
|||||||
Reference in New Issue
Block a user