Calendar-View: add short_month_day_format for week-views (#2392)

This commit is contained in:
Richard Schreiber
2021-12-21 11:19:58 +01:00
committed by GitHub
parent 0bf7bba6ba
commit b6273adc57
6 changed files with 14 additions and 4 deletions

View File

@@ -63,7 +63,9 @@ from pretix.base.models import (
from pretix.base.services.quotas import QuotaAvailability
from pretix.helpers.compat import date_fromisocalendar
from pretix.helpers.daterange import daterange
from pretix.helpers.formats.en.formats import WEEK_FORMAT
from pretix.helpers.formats.en.formats import (
SHORT_MONTH_DAY_FORMAT, WEEK_FORMAT,
)
from pretix.multidomain.urlreverse import eventreverse
from pretix.presale.ical import get_ical
from pretix.presale.views import OrganizerViewMixin
@@ -716,6 +718,9 @@ class WeekCalendarView(OrganizerViewMixin, EventListMixin, TemplateView):
ctx['week_format'] = get_format('WEEK_FORMAT')
if ctx['week_format'] == 'WEEK_FORMAT':
ctx['week_format'] = WEEK_FORMAT
ctx['short_month_day_format'] = get_format('SHORT_MONTH_DAY_FORMAT')
if ctx['short_month_day_format'] == 'SHORT_MONTH_DAY_FORMAT':
ctx['short_month_day_format'] = SHORT_MONTH_DAY_FORMAT
ctx['multiple_timezones'] = self._multiple_timezones
return ctx