Functional Weave
Code in Python

dates.bank-holidays@1.0.0

README.md

2,198 bytes · view raw

# dates.bank-holidays

The bank and public holidays for one UK region and one year, in date order, as
the UK government publishes them. The three regions are the ones gov.uk uses:
england-and-wales, scotland and northern-ireland. They differ: Scotland has
2 January and St Andrew's Day but no Easter Monday, and a different summer
holiday; Northern Ireland adds St Patrick's Day and the Battle of the Boyne.

Source: "UK bank holidays", GOV.UK, https://www.gov.uk/bank-holidays, taken
from its machine-readable form https://www.gov.uk/bank-holidays.json on
2026-09-22. That feed covers 2019 to 2028 for every region, and so does this
version. Every row is copied from it: dates, titles (gov.uk's wording,
curly apostrophes included) and the "Substitute day" note, which becomes
`substitute: true`.

The holidays are data, not rules in code. Easter moves, holidays falling on a
weekend are substituted by proclamation, and one-off holidays are added at a
few months' notice: the Platinum Jubilee (3 June 2022, which also moved the
spring holiday to 2 June), the State Funeral of Queen Elizabeth II (19
September 2022), the coronation of King Charles III (8 May 2023), the VE day
move of the early May holiday (8 May 2020) and Scotland's World Cup bank
holiday (15 June 2026). No formula produces those, which is why this is a
table. When gov.uk publishes another year or another one-off holiday, that is a
new version of this capability, not a code change.

A year outside the published range is an error, not an empty list. An empty
list would read as "no holidays that year", and a deadline calculation would
silently count Christmas Day as a working day.

The data deliberately has no `effective` columns. A bank holiday is an event
on a date, not a rule that stays in force until superseded, so there is
nothing for `history=current` to keep; declaring the columns would let a
project-wide history setting prune the whole calendar away.

This lists days, it does not count them. To skip holidays in working-day
arithmetic, pass the dates to dates.add-business-days or
dates.business-days-between, which take an explicit holiday list so they work
for any country and any employer's closure days.