Track dates of English school holidays

Fixes #168
This commit is contained in:
Edward Betts 2026-02-21 18:05:19 +00:00
parent 7a50ea6016
commit 61e17d9c96
10 changed files with 416 additions and 4 deletions

View file

@ -27,6 +27,7 @@
"waste_schedule": "Waste schedule",
"gwr_advance_tickets": "GWR advance tickets",
"critical_mass": "Critical Mass",
"uk_school_holiday": "UK school holiday",
}
%}
@ -34,6 +35,7 @@
"bank_holiday": "bg-success-subtle",
"conference": "bg-primary-subtle",
"us_holiday": "bg-secondary-subtle",
"uk_school_holiday": "bg-warning-subtle",
"birthday": "bg-info-subtle",
"waste_schedule": "bg-danger-subtle",
} %}
@ -132,7 +134,7 @@
end: {{event.end_date.strftime("%H:%M") }}
(duration: {{duration}})
{% elif event.end_date != event.date %}
{{event.end_date}}
to {{ event.end_as_date.strftime("%a, %d, %b") }}
{% endif %}
{% endif %}
</div>

View file

@ -4,7 +4,7 @@
{% block content %}
<div class="container-fluid mt-2">
<h1>Holidays</h1>
<h1>Public holidays</h1>
<table class="table table-hover w-auto">
{% for item in items %}
{% set country = get_country(item.country) %}
@ -20,5 +20,17 @@
</tr>
{% endfor %}
</table>
<h2>UK school holidays (Bristol)</h2>
<table class="table table-hover w-auto">
{% for item in school_holidays %}
<tr>
<td class="text-end">{{ display_date(item.as_date) }}</td>
<td>to {{ display_date(item.end_as_date) }}</td>
<td>in {{ (item.as_date - today).days }} days</td>
<td>{{ item.title }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}

View file

@ -403,6 +403,15 @@ https://www.flightradar24.com/data/flights/{{ flight.airline_detail.iata | lower
<h3>
{{ trip_link(trip) }}
<small class="text-muted">({{ display_date(trip.start) }})</small></h3>
{% set school_holidays = trip_school_holiday_map.get(trip.start.isoformat(), []) if trip_school_holiday_map is defined else [] %}
{% if school_holidays %}
<div>
<span class="badge bg-warning text-dark">UK school holiday</span>
{% for item in school_holidays %}
<span class="text-muted">{{ item.title }} ({{ display_date_no_year(item.as_date) }} to {{ display_date_no_year(item.end_as_date) }})</span>
{% endfor %}
</div>
{% endif %}
<ul class="list-unstyled">
{% for c in trip.countries %}
<li>

View file

@ -399,6 +399,23 @@
{% endif %}
</div>
<div class="mt-3">
<h4>UK school holidays (Bristol)</h4>
{% if school_holidays %}
<table class="table table-hover w-auto">
{% for item in school_holidays %}
<tr>
<td class="text-end">{{ display_date(item.as_date) }}</td>
<td>to {{ display_date(item.end_as_date) }}</td>
<td>{{ item.title }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No UK school holidays during trip.</p>
{% endif %}
</div>
{{ next_and_previous() }}
</div>