Compare commits

...

2 Commits

Author SHA1 Message Date
Richard Schreiber
39db3650ad fix isort 2021-12-21 10:37:53 +01:00
Richard Schreiber
81ea417e02 add short_month_day_format 2021-12-21 10:18:39 +01:00
6 changed files with 14 additions and 4 deletions

View File

@@ -39,3 +39,4 @@ SHORT_DATETIME_FORMAT = 'Y-m-d H:i'
TIME_FORMAT = 'H:i'
WEEK_FORMAT = '\\W W, o'
WEEK_DAY_FORMAT = 'D, M jS'
SHORT_MONTH_DAY_FORMAT = 'd.m.'

View File

@@ -26,6 +26,7 @@ SHORT_DATETIME_FORMAT = 'm/d/Y P'
TIME_FORMAT = 'P'
WEEK_FORMAT = '\\W W, o'
WEEK_DAY_FORMAT = 'D, M jS'
SHORT_MONTH_DAY_FORMAT = 'm/d'
DATE_INPUT_FORMATS = [
'%m/%d/%Y',

View File

@@ -24,7 +24,7 @@
<option value="{{ w.0.isocalendar.0 }}-W{{ w.0.isocalendar.1 }}"
{% if w.0.isocalendar.0 == subevent_list.date.isocalendar.0 and w.0.isocalendar.1 == subevent_list.date.isocalendar.1 %}selected{% endif %}>
{{ w.0|date:subevent_list.week_format }}
({{ w.0|date:"MONTH_DAY_FORMAT" }} {{ w.1|date:"MONTH_DAY_FORMAT" }})
({{ w.0|date:subevent_list.short_month_day_format }} {{ w.1|date:subevent_list.short_month_day_format }})
</option>
{% endfor %}
</optgroup>

View File

@@ -30,7 +30,7 @@
<option value="{{ w.0.isocalendar.0 }}-W{{ w.0.isocalendar.1 }}"
{% if w.0.isocalendar.0 == date.isocalendar.0 and w.0.isocalendar.1 == date.isocalendar.1 %}selected{% endif %}>
{{ w.0|date:week_format }}
({{ w.0|date:"MONTH_DAY_FORMAT" }} {{ w.1|date:"MONTH_DAY_FORMAT" }})
({{ w.0|date:short_month_day_format }} {{ w.1|date:short_month_day_format }})
</option>
{% endfor %}
</optgroup>

View File

@@ -77,7 +77,7 @@ from pretix.presale.views.organizer import (
filter_qs_by_attr, weeks_for_template,
)
from ...helpers.formats.en.formats import WEEK_FORMAT
from ...helpers.formats.en.formats import SHORT_MONTH_DAY_FORMAT, WEEK_FORMAT
from . import (
CartMixin, EventViewMixin, allow_frame_if_namespaced, get_cart,
iframe_entry_view_wrapper,
@@ -638,6 +638,9 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
context['week_format'] = get_format('WEEK_FORMAT')
if context['week_format'] == 'WEEK_FORMAT':
context['week_format'] = WEEK_FORMAT
context['short_month_day_format'] = get_format('SHORT_MONTH_DAY_FORMAT')
if context['short_month_day_format'] == 'SHORT_MONTH_DAY_FORMAT':
context['short_month_day_format'] = SHORT_MONTH_DAY_FORMAT
else:
context['subevent_list'] = self.request.event.subevents_sorted(
filter_qs_by_attr(self.request.event.subevents_annotated(self.request.sales_channel.identifier).using(settings.DATABASE_REPLICA), self.request)

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