Weekend page to show full year.

Highlight current week.
This commit is contained in:
Edward Betts 2025-01-24 20:49:16 +01:00
parent 2f574264e5
commit f5a8676336
3 changed files with 30 additions and 19 deletions

View file

@ -224,11 +224,17 @@ async def gaps_page() -> str:
@app.route("/weekends")
async def weekends() -> str:
"""List of available gaps."""
now = datetime.now()
today = date.today()
current_week_number = today.isocalendar().week
start = date(today.year, 1, 1)
trip_list = agenda.trip.build_trip_list()
busy_events = agenda.busy.get_busy_events(now.date(), app.config, trip_list)
weekends = agenda.busy.weekends(busy_events)
return flask.render_template("weekends.html", today=now.date(), items=weekends)
busy_events = agenda.busy.get_busy_events(start, app.config, trip_list)
weekends = agenda.busy.weekends(start, busy_events)
return flask.render_template(
"weekends.html", items=weekends, current_week_number=current_week_number
)
@app.route("/travel")