Show current-year school holidays and add Bristol source link
Closes #209 Closes #210
This commit is contained in:
parent
1397805450
commit
016039e78f
2 changed files with 8 additions and 2 deletions
|
|
@ -21,7 +21,10 @@
|
|||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<h2>UK school holidays (Bristol)</h2>
|
||||
<h2>
|
||||
UK school holidays (Bristol)
|
||||
<small class="fs-6 ms-2"><a href="{{ school_holiday_page_url }}">source</a></small>
|
||||
</h2>
|
||||
<table class="table table-hover w-auto">
|
||||
{% for item in school_holidays %}
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import agenda.stats
|
|||
import agenda.thespacedevs
|
||||
import agenda.trip
|
||||
import agenda.trip_schengen
|
||||
import agenda.uk_school_holiday
|
||||
import agenda.utils
|
||||
import agenda.weather
|
||||
from agenda import ical, calendar, format_list_with_ampersand, travel, uk_tz
|
||||
|
|
@ -885,10 +886,11 @@ def holiday_list() -> str:
|
|||
"""List of holidays."""
|
||||
today = date.today()
|
||||
data_dir = app.config["DATA_DIR"]
|
||||
year_start = date(today.year, 1, 1)
|
||||
next_year = today + timedelta(days=1 * 365)
|
||||
items = agenda.holidays.get_all(today - timedelta(days=2), next_year, data_dir)
|
||||
school_holidays = agenda.holidays.get_school_holidays(
|
||||
today - timedelta(days=2), next_year, data_dir
|
||||
year_start, next_year, data_dir
|
||||
)
|
||||
|
||||
items.sort(key=lambda item: (item.date, item.country))
|
||||
|
|
@ -898,6 +900,7 @@ def holiday_list() -> str:
|
|||
"holiday_list.html",
|
||||
items=items,
|
||||
school_holidays=school_holidays,
|
||||
school_holiday_page_url=agenda.uk_school_holiday.school_holiday_page_url,
|
||||
get_country=agenda.get_country,
|
||||
today=today,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue