diff --git a/src/pretix/base/models/event.py b/src/pretix/base/models/event.py index 464d534f51..fba40fc933 100644 --- a/src/pretix/base/models/event.py +++ b/src/pretix/base/models/event.py @@ -179,6 +179,12 @@ class EventMixin: self.date_to.astimezone(tz), ("D" if short else "l") ) + def is_same_day(self): + if not self.date_to: + return True + else: + return self.date_from.astimezone(self.timezone).date() == self.date_to.astimezone(self.timezone).date() + def get_date_range_display(self, tz=None, force_show_end=False, as_html=False, try_to_show_times=False) -> str: """ Returns a formatted string containing the start date and the end date diff --git a/src/pretix/presale/templates/pretixpresale/event/fragment_subevent_list.html b/src/pretix/presale/templates/pretixpresale/event/fragment_subevent_list.html index 7d8400951a..431cf840ac 100644 --- a/src/pretix/presale/templates/pretixpresale/event/fragment_subevent_list.html +++ b/src/pretix/presale/templates/pretixpresale/event/fragment_subevent_list.html @@ -1,6 +1,7 @@ {% load i18n %} {% load icon %} {% load eventurl %} +{% load date_fast %}
diff --git a/src/pretix/presale/templates/pretixpresale/organizers/index.html b/src/pretix/presale/templates/pretixpresale/organizers/index.html index 7013b5693c..231f7111b7 100644 --- a/src/pretix/presale/templates/pretixpresale/organizers/index.html +++ b/src/pretix/presale/templates/pretixpresale/organizers/index.html @@ -67,7 +67,7 @@ {% icon "clock-o" %} {% trans "Time of day" %} - {% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %} + {% if e.settings.show_date_to and e.date_to and e.is_same_day %} {% trans "until" context "timerange" %} {% endif %}