From 3964ea162bcad03de982cf76f5a30e64868508e7 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 25 Mar 2024 11:46:56 +0200 Subject: Show "Start/end date" instead of "time" when whole day event mode is on --- templates/manage.html.j2 | 4 ++-- templates/poll_choice_datetime_range.html.j2 | 25 ++++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'templates') diff --git a/templates/manage.html.j2 b/templates/manage.html.j2 index 1df54a1..270e837 100644 --- a/templates/manage.html.j2 +++ b/templates/manage.html.j2 @@ -29,8 +29,8 @@ - - + + diff --git a/templates/poll_choice_datetime_range.html.j2 b/templates/poll_choice_datetime_range.html.j2 index ddfa970..42700ab 100644 --- a/templates/poll_choice_datetime_range.html.j2 +++ b/templates/poll_choice_datetime_range.html.j2 @@ -1,11 +1,14 @@ -{{ choice.start_datetime.strftime("%a %d.%m") }} + {% if now.year != choice.start_datetime.year %} + {{ choice.start_datetime.strftime("%a %d.%m.%Y") }} + {% else %} + {{ choice.start_datetime.strftime("%a %d.%m") }} + {% endif %} - {% if now.year != choice.start_datetime.year %}.{{choice.start_datetime.year}}{% endif %} - - - {% if not poll.is_whole_day %}{{ choice.start_datetime.strftime("%H:%M") }}{% endif %} + {% if not poll.is_whole_day %} + {{ choice.start_datetime.strftime("%H:%M") }} + {% endif %} {% if (poll.is_whole_day and not choice.ends_on_same_day()) or (not poll.is_whole_day and not choice.ends_at_same_datetime()) %} @@ -13,12 +16,16 @@ {% if not choice.ends_on_same_day() %} + {% if now.year != choice.end_datetime.year %} + {{ choice.end_datetime.strftime("%a %d.%m.%Y") }} + {% else %} {{ choice.end_datetime.strftime("%a %d.%m") }} - - - {% if now.year != choice.end_datetime.year %}.{{choice.end_datetime.year}}{% endif %} + {% endif %} {% endif %} + - {% if not poll.is_whole_day %}{{ choice.end_datetime.strftime("%H:%M") }}{% endif %} + {% if not poll.is_whole_day %} + {{ choice.end_datetime.strftime("%H:%M") }} + {% endif %} -- cgit v1.3
Start timeEnd time{% if poll.is_whole_day %}Start date{% else %}Start time{% endif %}{% if poll.is_whole_day %}End date{% else %}End time{% endif %}