Fix test failing due to tz

This commit is contained in:
Raphael Michel
2023-02-01 12:27:22 +01:00
parent 8b81ef6f43
commit 1d46a96821

View File

@@ -620,8 +620,8 @@ class CalendarView(OrganizerViewMixin, EventListMixin, TemplateView):
raise Http404()
tz = get_current_timezone()
before = tz.localize(datetime(self.year, self.month, 1, 0, 0, 0)) - timedelta(days=1)
after = tz.localize(datetime(self.year, self.month, ndays, 0, 0, 0)) + timedelta(days=1)
before = datetime(self.year, self.month, 1, 0, 0, 0, tzinfo=tz) - timedelta(days=1)
after = datetime(self.year, self.month, ndays, 0, 0, 0, tzinfo=tz) + timedelta(days=1)
ctx['date'] = date(self.year, self.month, 1)
ctx['before'] = before