Add Christmas day

Closes: #4
This commit is contained in:
Edward Betts 2023-10-03 11:32:04 +01:00
parent c1364482fe
commit d26e4535bc
2 changed files with 11 additions and 0 deletions

View file

@ -183,6 +183,11 @@ def next_economist(input_date: date) -> date:
return next_thursday_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: def uk_financial_year_end(input_date: date) -> date:
"""Next date of the end of the UK financial year, April 5th.""" """Next date of the end of the UK financial year, April 5th."""
# Determine the year of the input date # 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), "fathers_day": next_uk_fathers_day(today),
"uk_financial_year_end": uk_financial_year_end(today), "uk_financial_year_end": uk_financial_year_end(today),
"xmas_last_posting_dates": xmas_last_posting_dates, "xmas_last_posting_dates": xmas_last_posting_dates,
"xmas_day": xmas_day(today),
} }
return reply return reply

View file

@ -66,6 +66,11 @@
{{days(xmas_last_posting_dates["first"])}} {{days(xmas_last_posting_dates["first"])}}
{{xmas_last_posting_dates["first"].strftime("%a, %d %b %Y")}}</li> {{xmas_last_posting_dates["first"].strftime("%a, %d %b %Y")}}</li>
<li>Christmas day:
{{days(xmas_day)}}
{{xmas_day.strftime("%a, %d %b %Y")}}</li>
</ul> </ul>
<h3>Stock markets</h3> <h3>Stock markets</h3>