diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-03-25 11:46:56 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2024-12-21 19:43:13 +0200 |
| commit | 3964ea162bcad03de982cf76f5a30e64868508e7 (patch) | |
| tree | 0d2fd56addb91e3538451b901ffa8ad85061ff44 | |
| parent | 3231fbd478788dcde6e4bf87521bda7c462c5bee (diff) | |
Show "Start/end date" instead of "time" when whole day event mode is on
| -rw-r--r-- | templates/manage.html.j2 | 4 | ||||
| -rw-r--r-- | templates/poll_choice_datetime_range.html.j2 | 25 |
2 files changed, 18 insertions, 11 deletions
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 @@ <table class="manage-table"> <thead> <tr> - <th>Start time</th> - <th>End time</th> + <th>{% if poll.is_whole_day %}Start date{% else %}Start time{% endif %}</th> + <th>{% if poll.is_whole_day %}End date{% else %}End time{% endif %}</th> <th></th> </tr> </thead> 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 @@ <span> -{{ 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 %} </span> <span> - {% if now.year != choice.start_datetime.year %}.{{choice.start_datetime.year}}{% endif %} -</span> -<span> - {% 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 %} </span> {% 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()) %} <span>—</span> @@ -13,12 +16,16 @@ {% if not choice.ends_on_same_day() %} <span> + {% if now.year != choice.end_datetime.year %} + {{ choice.end_datetime.strftime("%a %d.%m.%Y") }} + {% else %} {{ choice.end_datetime.strftime("%a %d.%m") }} -</span> -<span> - {% if now.year != choice.end_datetime.year %}.{{choice.end_datetime.year}}{% endif %} + {% endif %} </span> {% endif %} + <span> - {% 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 %} </span> |
