From 3213fb576a0aec19527f44237fbcfe4b65af6f29 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 29 Feb 2024 16:14:57 +0200 Subject: Show end datetime if not the same date --- templates/poll_vote_list.html.j2 | 15 ++++++++++++++- templates/poll_vote_table.html.j2 | 14 +++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/poll_vote_list.html.j2 b/templates/poll_vote_list.html.j2 index 2170d40..c18b3e0 100644 --- a/templates/poll_vote_list.html.j2 +++ b/templates/poll_vote_list.html.j2 @@ -9,7 +9,20 @@ {% if now.year != choice.start_datetime.year %}.{{choice.start_datetime.year}}{% endif %} - {{ choice.start_datetime.strftime("%H:%M") }} – {{ choice.end_datetime.strftime("%H:%M") }} + {{ choice.start_datetime.strftime("%H:%M") }} + + + {% if not choice.ends_on_same_day() %} + + {{ choice.end_datetime.strftime("%a %d.%m") }} + + + {% if now.year != choice.end_datetime.year %}.{{choice.end_datetime.year}}{% endif %} + + {% endif %} + + {{ choice.end_datetime.strftime("%H:%M") }} + diff --git a/templates/poll_vote_table.html.j2 b/templates/poll_vote_table.html.j2 index 072d17a..cfa336a 100644 --- a/templates/poll_vote_table.html.j2 +++ b/templates/poll_vote_table.html.j2 @@ -8,7 +8,19 @@ {% if now.year != choice.start_datetime.year %}.{{choice.start_datetime.year}}{% endif %} - {{ choice.start_datetime.strftime("%H:%M") }} – {{ choice.end_datetime.strftime("%H:%M") }} + {{ choice.start_datetime.strftime("%H:%M") }} + + + {% if not choice.ends_on_same_day() %} + + {{ choice.end_datetime.strftime("%a %d.%m") }} + + + {% if now.year != choice.end_datetime.year %}.{{choice.end_datetime.year}}{% endif %} + + {% endif %} + + {{ choice.end_datetime.strftime("%H:%M") }} {{ choice.votes | length }} votes -- cgit v1.3