Add last Christmas posting day

Closes: #5
This commit is contained in:
Edward Betts 2023-10-03 09:54:13 +01:00
parent 760ebc6980
commit c1364482fe
2 changed files with 12 additions and 0 deletions

View file

@ -38,6 +38,8 @@ now_utc = datetime.now(timezone.utc)
next_us_presidential_election = date(2024, 11, 5) next_us_presidential_election = date(2024, 11, 5)
next_uk_general_election = date(2024, 5, 2) next_uk_general_election = date(2024, 5, 2)
xmas_last_posting_dates = {"first": date(2023, 12, 20), "second": date(2023, 12, 18)}
config_filename = os.path.join(os.path.dirname(__file__), "..", "config") config_filename = os.path.join(os.path.dirname(__file__), "..", "config")
assert os.path.exists(config_filename) assert os.path.exists(config_filename)
@ -276,6 +278,7 @@ def get_data() -> dict[str, str | object]:
"mothers_day": next_uk_mothers_day(today), "mothers_day": next_uk_mothers_day(today),
"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,
} }
return reply return reply

View file

@ -57,6 +57,15 @@
<li>US pres. election: <li>US pres. election:
{{days(next_us_presidential_election)}} {{days(next_us_presidential_election)}}
{{next_us_presidential_election.strftime("%a, %d %b %Y")}}</li> {{next_us_presidential_election.strftime("%a, %d %b %Y")}}</li>
<li>Christmas last posting 2nd class:
{{days(xmas_last_posting_dates["second"])}}
{{xmas_last_posting_dates["second"].strftime("%a, %d %b %Y")}}</li>
<li>Christmas last posting 1st class:
{{days(xmas_last_posting_dates["first"])}}
{{xmas_last_posting_dates["first"].strftime("%a, %d %b %Y")}}</li>
</ul> </ul>
<h3>Stock markets</h3> <h3>Stock markets</h3>