Handle date-only transport times in trip page template
This commit is contained in:
parent
2a69904ef1
commit
d9b08f3e5b
2 changed files with 72 additions and 3 deletions
|
|
@ -281,7 +281,9 @@
|
|||
{% set item = e.detail %}
|
||||
{% set full_flight_number = item.airline_code + item.flight_number %}
|
||||
{% set radarbox_url = "https://www.radarbox.com/data/flights/" + full_flight_number %}
|
||||
{% set is_overnight = item.arrive and item.depart.date() != item.arrive.date() %}
|
||||
{% set depart_date = item.depart.date() if item.depart.hour is defined else item.depart %}
|
||||
{% set arrive_date = item.arrive.date() if (item.arrive and item.arrive.hour is defined) else item.arrive %}
|
||||
{% set is_overnight = item.arrive and depart_date != arrive_date %}
|
||||
<div class="trip-transport-card my-1">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
|
|
@ -317,7 +319,9 @@
|
|||
|
||||
{% elif e.element_type == "train" %}
|
||||
{% set item = e.detail %}
|
||||
{% set is_overnight = item.depart.date() != item.arrive.date() %}
|
||||
{% set depart_date = item.depart.date() if item.depart.hour is defined else item.depart %}
|
||||
{% set arrive_date = item.arrive.date() if item.arrive.hour is defined else item.arrive %}
|
||||
{% set is_overnight = depart_date != arrive_date %}
|
||||
<div class="trip-transport-card my-1">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue