Do not show event time on invoice

This commit is contained in:
Raphael Michel
2020-09-25 18:01:50 +02:00
parent 450d017c32
commit 4cb18218b2
2 changed files with 5 additions and 5 deletions

View File

@@ -396,13 +396,13 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
p_str = ( p_str = (
shorten(self.invoice.event.name) + '\n' + shorten(self.invoice.event.name) + '\n' +
pgettext('invoice', '{from_date}\nuntil {to_date}').format( pgettext('invoice', '{from_date}\nuntil {to_date}').format(
from_date=self.invoice.event.get_date_from_display(), from_date=self.invoice.event.get_date_from_display(show_times=False),
to_date=self.invoice.event.get_date_to_display() to_date=self.invoice.event.get_date_to_display(show_times=False)
) )
) )
else: else:
p_str = ( p_str = (
shorten(self.invoice.event.name) + '\n' + self.invoice.event.get_date_from_display() shorten(self.invoice.event.name) + '\n' + self.invoice.event.get_date_from_display(show_times=False)
) )
else: else:
p_str = shorten(self.invoice.event.name) p_str = shorten(self.invoice.event.name)

View File

@@ -89,7 +89,7 @@ class EventMixin:
self.date_from.astimezone(tz), "TIME_FORMAT" self.date_from.astimezone(tz), "TIME_FORMAT"
) )
def get_date_to_display(self, tz=None, short=False) -> str: def get_date_to_display(self, tz=None, show_times=True, short=False) -> str:
""" """
Returns a formatted string containing the start date of the event with respect Returns a formatted string containing the start date of the event with respect
to the current locale and to the ``show_times`` setting. Returns an empty string to the current locale and to the ``show_times`` setting. Returns an empty string
@@ -100,7 +100,7 @@ class EventMixin:
return "" return ""
return _date( return _date(
self.date_to.astimezone(tz), self.date_to.astimezone(tz),
("SHORT_" if short else "") + ("DATETIME_FORMAT" if self.settings.show_times else "DATE_FORMAT") ("SHORT_" if short else "") + ("DATETIME_FORMAT" if self.settings.show_times and show_times else "DATE_FORMAT")
) )
def get_date_range_display(self, tz=None, force_show_end=False) -> str: def get_date_range_display(self, tz=None, force_show_end=False) -> str: