Compare commits

...

2 Commits

Author SHA1 Message Date
Richard Schreiber
133faa67d4 fix code-style 2026-02-24 10:11:36 +01:00
Richard Schreiber
2625f3ee80 Exclude date_to from multi-day events that end at midnight 2026-02-24 09:57:06 +01:00

View File

@@ -531,6 +531,13 @@ def add_events_for_days(request, baseqs, before, after, ebd, timezones):
date_to = event.date_to.astimezone(tz).date()
d = max(date_from, before.date())
while d <= date_to and d <= after.date():
if (
date_to != date_from
and datetime_to.hour == 0 and datetime_to.minute == 0 and datetime_to.second == 0
and (d == date_to or d == after.date())
):
# multi-day event, but special case ends midnight, so do not show on the day it ends
break
first = d == date_from
ebd[d].append({
'event': event,
@@ -659,6 +666,13 @@ def add_subevents_for_days(qs, before, after, ebd, timezones, sales_channel, eve
date_to = se.date_to.astimezone(tz).date()
d = max(date_from, before.date())
while d <= date_to and d <= after.date():
if (
date_to != date_from
and datetime_to.hour == 0 and datetime_to.minute == 0 and datetime_to.second == 0
and (d == date_to or d == after.date())
):
# multi-day event, but special case ends midnight, so do not show on the day it ends
break
first = d == date_from
ebd[d].append({
'continued': not first,