Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add United Kingdom's Whit Monday holidays for pre-1971 years #1668

Merged
merged 5 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions holidays/countries/united_kingdom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from datetime import date
from typing import Tuple, Union

from holidays.calendars.gregorian import APR, MAY, JUN, JUL, SEP, DEC
Expand All @@ -25,8 +26,14 @@ class UnitedKingdom(ObservedHolidayBase, ChristianHolidays, InternationalHoliday
"""
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom
- https://archive.org/details/treatiseonbanki00walk/page/334/mode/2up
- https://www.gov.uk/bank-holidays
- https://www.timeanddate.com/holidays/uk/

The Anniversary of the Battle of the Boyne bank holiday is proclaimed annually by the
Secretary of State for Northern Ireland.

In-Lieu observance was first provided in the Bank Holidays Extension Act 1875.
"""

country = "GB"
Expand All @@ -53,7 +60,15 @@ def __init__(self, *args, **kwargs):
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
super().__init__(*args, **kwargs)

def _is_observed(self, dt: date) -> bool:
# Bank Holidays Extension Act 1875
return self._year >= 1875

PPsyrius marked this conversation as resolved.
Show resolved Hide resolved
def _populate_public_holidays(self) -> None:
# Bank Holidays Act 1871
if self._year <= 1871:
return None

# Good Friday
self._add_good_friday("Good Friday")

Expand Down Expand Up @@ -88,6 +103,10 @@ def _populate_public_holidays(self) -> None:
self._populate_subdiv_wls_public_holidays()

def _populate_subdiv_holidays(self):
# Bank Holidays Act 1871
if self._year <= 1871:
return None

if self.subdiv not in {"SCT", "Scotland"}:
# New Year's Day
if self._year >= 1975:
Expand All @@ -109,6 +128,10 @@ def _populate_subdiv_eng_public_holidays(self):
# Easter Monday
self._add_easter_monday("Easter Monday")

# Whit Monday.
PPsyrius marked this conversation as resolved.
Show resolved Hide resolved
if self._year <= 1970:
self._add_whit_monday("Whit Monday")

# Late Summer bank holiday (last Monday in August)
if self._year >= 1971:
self._add_holiday_last_mon_of_aug("Late Summer Bank Holiday")
Expand All @@ -121,6 +144,10 @@ def _populate_subdiv_nir_public_holidays(self):
# Easter Monday
self._add_easter_monday("Easter Monday")

# Whit Monday.
if self._year <= 1970:
self._add_whit_monday("Whit Monday")

# Battle of the Boyne
self._add_observed(self._add_holiday_jul_12("Battle of the Boyne"))

Expand Down Expand Up @@ -161,6 +188,10 @@ def _populate_subdiv_wls_public_holidays(self):
# Easter Monday
self._add_easter_monday("Easter Monday")

# Whit Monday.
if self._year <= 1970:
self._add_whit_monday("Whit Monday")

# Late Summer bank holiday (last Monday in August)
if self._year >= 1971:
self._add_holiday_last_mon_of_aug("Late Summer Bank Holiday")
Expand Down
21 changes: 21 additions & 0 deletions snapshots/countries/GB_ENG.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,117 @@
{
"1950-04-07": "Good Friday",
"1950-04-10": "Easter Monday",
"1950-05-29": "Whit Monday",
"1950-12-25": "Christmas Day",
"1950-12-26": "Boxing Day",
"1951-03-23": "Good Friday",
"1951-03-26": "Easter Monday",
"1951-05-14": "Whit Monday",
"1951-12-25": "Christmas Day",
"1951-12-26": "Boxing Day",
"1952-04-11": "Good Friday",
"1952-04-14": "Easter Monday",
"1952-06-02": "Whit Monday",
"1952-12-25": "Christmas Day",
"1952-12-26": "Boxing Day",
"1953-04-03": "Good Friday",
"1953-04-06": "Easter Monday",
"1953-05-25": "Whit Monday",
"1953-12-25": "Christmas Day",
"1953-12-26": "Boxing Day",
"1953-12-28": "Boxing Day (observed)",
"1954-04-16": "Good Friday",
"1954-04-19": "Easter Monday",
"1954-06-07": "Whit Monday",
"1954-12-25": "Christmas Day",
"1954-12-26": "Boxing Day",
"1954-12-27": "Christmas Day (observed)",
"1954-12-28": "Boxing Day (observed)",
"1955-04-08": "Good Friday",
"1955-04-11": "Easter Monday",
"1955-05-30": "Whit Monday",
"1955-12-25": "Christmas Day",
"1955-12-26": "Boxing Day",
"1955-12-27": "Christmas Day (observed)",
"1956-03-30": "Good Friday",
"1956-04-02": "Easter Monday",
"1956-05-21": "Whit Monday",
"1956-12-25": "Christmas Day",
"1956-12-26": "Boxing Day",
"1957-04-19": "Good Friday",
"1957-04-22": "Easter Monday",
"1957-06-10": "Whit Monday",
"1957-12-25": "Christmas Day",
"1957-12-26": "Boxing Day",
"1958-04-04": "Good Friday",
"1958-04-07": "Easter Monday",
"1958-05-26": "Whit Monday",
"1958-12-25": "Christmas Day",
"1958-12-26": "Boxing Day",
"1959-03-27": "Good Friday",
"1959-03-30": "Easter Monday",
"1959-05-18": "Whit Monday",
"1959-12-25": "Christmas Day",
"1959-12-26": "Boxing Day",
"1959-12-28": "Boxing Day (observed)",
"1960-04-15": "Good Friday",
"1960-04-18": "Easter Monday",
"1960-06-06": "Whit Monday",
"1960-12-25": "Christmas Day",
"1960-12-26": "Boxing Day",
"1960-12-27": "Christmas Day (observed)",
"1961-03-31": "Good Friday",
"1961-04-03": "Easter Monday",
"1961-05-22": "Whit Monday",
"1961-12-25": "Christmas Day",
"1961-12-26": "Boxing Day",
"1962-04-20": "Good Friday",
"1962-04-23": "Easter Monday",
"1962-06-11": "Whit Monday",
"1962-12-25": "Christmas Day",
"1962-12-26": "Boxing Day",
"1963-04-12": "Good Friday",
"1963-04-15": "Easter Monday",
"1963-06-03": "Whit Monday",
"1963-12-25": "Christmas Day",
"1963-12-26": "Boxing Day",
"1964-03-27": "Good Friday",
"1964-03-30": "Easter Monday",
"1964-05-18": "Whit Monday",
"1964-12-25": "Christmas Day",
"1964-12-26": "Boxing Day",
"1964-12-28": "Boxing Day (observed)",
"1965-04-16": "Good Friday",
"1965-04-19": "Easter Monday",
"1965-06-07": "Whit Monday",
"1965-12-25": "Christmas Day",
"1965-12-26": "Boxing Day",
"1965-12-27": "Christmas Day (observed)",
"1965-12-28": "Boxing Day (observed)",
"1966-04-08": "Good Friday",
"1966-04-11": "Easter Monday",
"1966-05-30": "Whit Monday",
"1966-12-25": "Christmas Day",
"1966-12-26": "Boxing Day",
"1966-12-27": "Christmas Day (observed)",
"1967-03-24": "Good Friday",
"1967-03-27": "Easter Monday",
"1967-05-15": "Whit Monday",
"1967-12-25": "Christmas Day",
"1967-12-26": "Boxing Day",
"1968-04-12": "Good Friday",
"1968-04-15": "Easter Monday",
"1968-06-03": "Whit Monday",
"1968-12-25": "Christmas Day",
"1968-12-26": "Boxing Day",
"1969-04-04": "Good Friday",
"1969-04-07": "Easter Monday",
"1969-05-26": "Whit Monday",
"1969-12-25": "Christmas Day",
"1969-12-26": "Boxing Day",
"1970-03-27": "Good Friday",
"1970-03-30": "Easter Monday",
"1970-05-18": "Whit Monday",
"1970-12-25": "Christmas Day",
"1970-12-26": "Boxing Day",
"1970-12-28": "Boxing Day (observed)",
Expand Down
21 changes: 21 additions & 0 deletions snapshots/countries/GB_NIR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@
"1950-03-17": "St. Patrick's Day",
"1950-04-07": "Good Friday",
"1950-04-10": "Easter Monday",
"1950-05-29": "Whit Monday",
"1950-07-12": "Battle of the Boyne",
"1950-12-25": "Christmas Day",
"1950-12-26": "Boxing Day",
"1951-03-17": "St. Patrick's Day",
"1951-03-19": "St. Patrick's Day (observed)",
"1951-03-23": "Good Friday",
"1951-03-26": "Easter Monday",
"1951-05-14": "Whit Monday",
"1951-07-12": "Battle of the Boyne",
"1951-12-25": "Christmas Day",
"1951-12-26": "Boxing Day",
"1952-03-17": "St. Patrick's Day",
"1952-04-11": "Good Friday",
"1952-04-14": "Easter Monday",
"1952-06-02": "Whit Monday",
"1952-07-12": "Battle of the Boyne",
"1952-07-14": "Battle of the Boyne (observed)",
"1952-12-25": "Christmas Day",
"1952-12-26": "Boxing Day",
"1953-03-17": "St. Patrick's Day",
"1953-04-03": "Good Friday",
"1953-04-06": "Easter Monday",
"1953-05-25": "Whit Monday",
"1953-07-12": "Battle of the Boyne",
"1953-07-13": "Battle of the Boyne (observed)",
"1953-12-25": "Christmas Day",
Expand All @@ -30,6 +34,7 @@
"1954-03-17": "St. Patrick's Day",
"1954-04-16": "Good Friday",
"1954-04-19": "Easter Monday",
"1954-06-07": "Whit Monday",
"1954-07-12": "Battle of the Boyne",
"1954-12-25": "Christmas Day",
"1954-12-26": "Boxing Day",
Expand All @@ -38,6 +43,7 @@
"1955-03-17": "St. Patrick's Day",
"1955-04-08": "Good Friday",
"1955-04-11": "Easter Monday",
"1955-05-30": "Whit Monday",
"1955-07-12": "Battle of the Boyne",
"1955-12-25": "Christmas Day",
"1955-12-26": "Boxing Day",
Expand All @@ -46,26 +52,30 @@
"1956-03-19": "St. Patrick's Day (observed)",
"1956-03-30": "Good Friday",
"1956-04-02": "Easter Monday",
"1956-05-21": "Whit Monday",
"1956-07-12": "Battle of the Boyne",
"1956-12-25": "Christmas Day",
"1956-12-26": "Boxing Day",
"1957-03-17": "St. Patrick's Day",
"1957-03-18": "St. Patrick's Day (observed)",
"1957-04-19": "Good Friday",
"1957-04-22": "Easter Monday",
"1957-06-10": "Whit Monday",
"1957-07-12": "Battle of the Boyne",
"1957-12-25": "Christmas Day",
"1957-12-26": "Boxing Day",
"1958-03-17": "St. Patrick's Day",
"1958-04-04": "Good Friday",
"1958-04-07": "Easter Monday",
"1958-05-26": "Whit Monday",
"1958-07-12": "Battle of the Boyne",
"1958-07-14": "Battle of the Boyne (observed)",
"1958-12-25": "Christmas Day",
"1958-12-26": "Boxing Day",
"1959-03-17": "St. Patrick's Day",
"1959-03-27": "Good Friday",
"1959-03-30": "Easter Monday",
"1959-05-18": "Whit Monday",
"1959-07-12": "Battle of the Boyne",
"1959-07-13": "Battle of the Boyne (observed)",
"1959-12-25": "Christmas Day",
Expand All @@ -74,33 +84,38 @@
"1960-03-17": "St. Patrick's Day",
"1960-04-15": "Good Friday",
"1960-04-18": "Easter Monday",
"1960-06-06": "Whit Monday",
"1960-07-12": "Battle of the Boyne",
"1960-12-25": "Christmas Day",
"1960-12-26": "Boxing Day",
"1960-12-27": "Christmas Day (observed)",
"1961-03-17": "St. Patrick's Day",
"1961-03-31": "Good Friday",
"1961-04-03": "Easter Monday",
"1961-05-22": "Whit Monday",
"1961-07-12": "Battle of the Boyne",
"1961-12-25": "Christmas Day",
"1961-12-26": "Boxing Day",
"1962-03-17": "St. Patrick's Day",
"1962-03-19": "St. Patrick's Day (observed)",
"1962-04-20": "Good Friday",
"1962-04-23": "Easter Monday",
"1962-06-11": "Whit Monday",
"1962-07-12": "Battle of the Boyne",
"1962-12-25": "Christmas Day",
"1962-12-26": "Boxing Day",
"1963-03-17": "St. Patrick's Day",
"1963-03-18": "St. Patrick's Day (observed)",
"1963-04-12": "Good Friday",
"1963-04-15": "Easter Monday",
"1963-06-03": "Whit Monday",
"1963-07-12": "Battle of the Boyne",
"1963-12-25": "Christmas Day",
"1963-12-26": "Boxing Day",
"1964-03-17": "St. Patrick's Day",
"1964-03-27": "Good Friday",
"1964-03-30": "Easter Monday",
"1964-05-18": "Whit Monday",
"1964-07-12": "Battle of the Boyne",
"1964-07-13": "Battle of the Boyne (observed)",
"1964-12-25": "Christmas Day",
Expand All @@ -109,6 +124,7 @@
"1965-03-17": "St. Patrick's Day",
"1965-04-16": "Good Friday",
"1965-04-19": "Easter Monday",
"1965-06-07": "Whit Monday",
"1965-07-12": "Battle of the Boyne",
"1965-12-25": "Christmas Day",
"1965-12-26": "Boxing Day",
Expand All @@ -117,33 +133,38 @@
"1966-03-17": "St. Patrick's Day",
"1966-04-08": "Good Friday",
"1966-04-11": "Easter Monday",
"1966-05-30": "Whit Monday",
"1966-07-12": "Battle of the Boyne",
"1966-12-25": "Christmas Day",
"1966-12-26": "Boxing Day",
"1966-12-27": "Christmas Day (observed)",
"1967-03-17": "St. Patrick's Day",
"1967-03-24": "Good Friday",
"1967-03-27": "Easter Monday",
"1967-05-15": "Whit Monday",
"1967-07-12": "Battle of the Boyne",
"1967-12-25": "Christmas Day",
"1967-12-26": "Boxing Day",
"1968-03-17": "St. Patrick's Day",
"1968-03-18": "St. Patrick's Day (observed)",
"1968-04-12": "Good Friday",
"1968-04-15": "Easter Monday",
"1968-06-03": "Whit Monday",
"1968-07-12": "Battle of the Boyne",
"1968-12-25": "Christmas Day",
"1968-12-26": "Boxing Day",
"1969-03-17": "St. Patrick's Day",
"1969-04-04": "Good Friday",
"1969-04-07": "Easter Monday",
"1969-05-26": "Whit Monday",
"1969-07-12": "Battle of the Boyne",
"1969-07-14": "Battle of the Boyne (observed)",
"1969-12-25": "Christmas Day",
"1969-12-26": "Boxing Day",
"1970-03-17": "St. Patrick's Day",
"1970-03-27": "Good Friday",
"1970-03-30": "Easter Monday",
"1970-05-18": "Whit Monday",
"1970-07-12": "Battle of the Boyne",
"1970-07-13": "Battle of the Boyne (observed)",
"1970-12-25": "Christmas Day",
Expand Down
Loading
Loading