From d26e4535bc2bd674f2f3eff68cabc9cf697de9e0 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 3 Oct 2023 11:32:04 +0100 Subject: [PATCH] Add Christmas day Closes: #4 --- agenda/__init__.py | 6 ++++++ templates/index.html | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/agenda/__init__.py b/agenda/__init__.py index fa8440b..83c93b0 100644 --- a/agenda/__init__.py +++ b/agenda/__init__.py @@ -183,6 +183,11 @@ def next_economist(input_date: date) -> date: return next_thursday_date +def xmas_day(input_date: date) -> date: + """Christmas day.""" + return date(input_date.year, 12, 25) + + def uk_financial_year_end(input_date: date) -> date: """Next date of the end of the UK financial year, April 5th.""" # Determine the year of the input date @@ -279,6 +284,7 @@ def get_data() -> dict[str, str | object]: "fathers_day": next_uk_fathers_day(today), "uk_financial_year_end": uk_financial_year_end(today), "xmas_last_posting_dates": xmas_last_posting_dates, + "xmas_day": xmas_day(today), } return reply diff --git a/templates/index.html b/templates/index.html index ac6d19b..58963a7 100644 --- a/templates/index.html +++ b/templates/index.html @@ -66,6 +66,11 @@ {{days(xmas_last_posting_dates["first"])}} {{xmas_last_posting_dates["first"].strftime("%a, %d %b %Y")}} +
  • Christmas day: + {{days(xmas_day)}} + {{xmas_day.strftime("%a, %d %b %Y")}}
  • + +

    Stock markets