Base trip timezone differences on trip dates and remove live local-time column

This commit is contained in:
Edward Betts 2026-02-26 15:31:13 +00:00
parent f2752383f2
commit f0698acd59
2 changed files with 38 additions and 29 deletions

View file

@ -108,7 +108,6 @@
<th>Destination</th>
<th>Timezone</th>
<th>Difference from UK</th>
<th>Current local time</th>
</tr>
</thead>
<tbody>
@ -117,7 +116,6 @@
<td>{{ item.destination_label }}</td>
<td>{{ item.timezone or "Unknown" }}</td>
<td class="destination-offset">{{ item.offset_display }}</td>
<td class="destination-time" {% if item.timezone %}data-timezone="{{ item.timezone }}"{% endif %}>{{ item.current_time or "Unknown" }}</td>
</tr>
{% endfor %}
</tbody>
@ -490,22 +488,5 @@ var routes = {{ routes | tojson }};
build_map("map", coordinates, routes);
function updateDestinationTimes() {
for (const el of document.querySelectorAll(".destination-time[data-timezone]")) {
const tz = el.dataset.timezone;
el.textContent = new Intl.DateTimeFormat("en-GB", {
timeZone: tz,
weekday: "short",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
hour12: false
}).format(new Date());
}
}
updateDestinationTimes();
setInterval(updateDestinationTimes, 1000);
</script>
{% endblock %}