From bca4d49a71788e3b6c6fbe6da1d5620f047c7d06 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:41:44 +0700 Subject: [PATCH 1/4] [GB] Whit Monday holidays pre-1971 --- holidays/countries/united_kingdom.py | 31 ++++++++++++++++ snapshots/countries/GB_ENG.json | 21 +++++++++++ snapshots/countries/GB_NIR.json | 21 +++++++++++ snapshots/countries/GB_WLS.json | 21 +++++++++++ snapshots/countries/UK_ENG.json | 21 +++++++++++ snapshots/countries/UK_NIR.json | 21 +++++++++++ snapshots/countries/UK_WLS.json | 21 +++++++++++ tests/countries/test_united_kingdom.py | 50 ++++++++++++++++++++++++++ 8 files changed, 207 insertions(+) diff --git a/holidays/countries/united_kingdom.py b/holidays/countries/united_kingdom.py index f158607ba..f72e44baa 100644 --- a/holidays/countries/united_kingdom.py +++ b/holidays/countries/united_kingdom.py @@ -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 @@ -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" @@ -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 + def _populate_public_holidays(self) -> None: + # Bank Holidays Act 1871 + if self._year <= 1871: + return None + # Good Friday self._add_good_friday("Good Friday") @@ -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: @@ -109,6 +128,10 @@ def _populate_subdiv_eng_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") @@ -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")) @@ -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") diff --git a/snapshots/countries/GB_ENG.json b/snapshots/countries/GB_ENG.json index 3198045fb..fb8aec32f 100644 --- a/snapshots/countries/GB_ENG.json +++ b/snapshots/countries/GB_ENG.json @@ -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)", diff --git a/snapshots/countries/GB_NIR.json b/snapshots/countries/GB_NIR.json index 6ab174bed..3cfc2e27b 100644 --- a/snapshots/countries/GB_NIR.json +++ b/snapshots/countries/GB_NIR.json @@ -2,6 +2,7 @@ "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", @@ -9,12 +10,14 @@ "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", @@ -22,6 +25,7 @@ "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", @@ -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", @@ -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", @@ -46,6 +52,7 @@ "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", @@ -53,12 +60,14 @@ "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", @@ -66,6 +75,7 @@ "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", @@ -74,6 +84,7 @@ "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", @@ -81,6 +92,7 @@ "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", @@ -88,6 +100,7 @@ "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", @@ -95,12 +108,14 @@ "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", @@ -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", @@ -117,6 +133,7 @@ "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", @@ -124,6 +141,7 @@ "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", @@ -131,12 +149,14 @@ "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", @@ -144,6 +164,7 @@ "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", diff --git a/snapshots/countries/GB_WLS.json b/snapshots/countries/GB_WLS.json index 3198045fb..fb8aec32f 100644 --- a/snapshots/countries/GB_WLS.json +++ b/snapshots/countries/GB_WLS.json @@ -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)", diff --git a/snapshots/countries/UK_ENG.json b/snapshots/countries/UK_ENG.json index 3198045fb..fb8aec32f 100644 --- a/snapshots/countries/UK_ENG.json +++ b/snapshots/countries/UK_ENG.json @@ -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)", diff --git a/snapshots/countries/UK_NIR.json b/snapshots/countries/UK_NIR.json index 6ab174bed..3cfc2e27b 100644 --- a/snapshots/countries/UK_NIR.json +++ b/snapshots/countries/UK_NIR.json @@ -2,6 +2,7 @@ "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", @@ -9,12 +10,14 @@ "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", @@ -22,6 +25,7 @@ "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", @@ -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", @@ -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", @@ -46,6 +52,7 @@ "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", @@ -53,12 +60,14 @@ "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", @@ -66,6 +75,7 @@ "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", @@ -74,6 +84,7 @@ "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", @@ -81,6 +92,7 @@ "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", @@ -88,6 +100,7 @@ "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", @@ -95,12 +108,14 @@ "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", @@ -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", @@ -117,6 +133,7 @@ "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", @@ -124,6 +141,7 @@ "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", @@ -131,12 +149,14 @@ "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", @@ -144,6 +164,7 @@ "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", diff --git a/snapshots/countries/UK_WLS.json b/snapshots/countries/UK_WLS.json index 3198045fb..fb8aec32f 100644 --- a/snapshots/countries/UK_WLS.json +++ b/snapshots/countries/UK_WLS.json @@ -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)", diff --git a/tests/countries/test_united_kingdom.py b/tests/countries/test_united_kingdom.py index 2543f0f23..94b2ffd68 100644 --- a/tests/countries/test_united_kingdom.py +++ b/tests/countries/test_united_kingdom.py @@ -39,6 +39,14 @@ def test_country_aliases(self): self.assertAliases(UnitedKingdom, UK, GBR) self.assertAliases(UnitedKingdom, GB, GBR) + def test_no_holidays(self): + self.assertNoHolidays(UnitedKingdom(years=1870)) + self.assertNoHolidays(UnitedKingdom(years=1870, subdiv="ENG")) + self.assertNoHolidays(UnitedKingdom(years=1870, subdiv="NIR")) + self.assertNoHolidays(UnitedKingdom(years=1870, subdiv="SCT")) + self.assertNoHolidays(UnitedKingdom(years=1870, subdiv="WLS")) + self.assertNoHoliday("1871-01-02", "1874-12-28") + def test_special_holidays(self): self.assertHoliday( "1977-06-07", @@ -203,6 +211,48 @@ def test_may_day(self): ) self.assertNoHolidayName(name, range(1950, 1978)) + def test_whit_monday(self): + name = "Whit Monday" + dt = ( + "1950-05-29", + "1951-05-14", + "1952-06-02", + "1953-05-25", + "1954-06-07", + "1955-05-30", + "1956-05-21", + "1957-06-10", + "1958-05-26", + "1959-05-18", + "1960-06-06", + "1961-05-22", + "1962-06-11", + "1963-06-03", + "1964-05-18", + "1965-06-07", + "1966-05-30", + "1967-05-15", + "1968-06-03", + "1969-05-26", + "1970-05-18", + ) + for subdiv in ( + "ENG", + "NIR", + "WLS", + "England", + "Northern Ireland", + "Wales", + ): + self.assertHolidayName(name, self.subdiv_holidays[subdiv], dt) + + for subdiv in ("SCT", "Scotland"): + self.assertNoHoliday(self.subdiv_holidays[subdiv], dt) + self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1950, 2050)) + + self.assertNoHoliday(dt) + self.assertNoHolidayName(name, range(1950, 2050)) + def test_spring_bank_holiday(self): name = "Spring Bank Holiday" self.assertHolidayName( From 5dc40ce81f1c7bba0a772f173bfb771560b90392 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Fri, 26 Jan 2024 19:23:59 +0700 Subject: [PATCH 2/4] [GB] _is_observed now integrated into __init__ Co-authored-by: ~Jhellico --- holidays/countries/united_kingdom.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/holidays/countries/united_kingdom.py b/holidays/countries/united_kingdom.py index f72e44baa..8ef51bc6a 100644 --- a/holidays/countries/united_kingdom.py +++ b/holidays/countries/united_kingdom.py @@ -58,11 +58,9 @@ def __init__(self, *args, **kwargs): InternationalHolidays.__init__(self) StaticHolidays.__init__(self, UnitedKingdomStaticHolidays) 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 + kwargs.setdefault("observed_since", 1875) + super().__init__(*args, **kwargs) def _populate_public_holidays(self) -> None: # Bank Holidays Act 1871 From f626bc9ab96c5d706aae2a00a9f4446985136c32 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Fri, 26 Jan 2024 19:26:54 +0700 Subject: [PATCH 3/4] [GB] Isle of Man now also have Whit Monday pre-1971 --- holidays/countries/united_kingdom.py | 17 ++++------------- snapshots/countries/GB_COMMON.json | 21 +++++++++++++++++++++ snapshots/countries/IM_COMMON.json | 21 +++++++++++++++++++++ snapshots/countries/UK_COMMON.json | 21 +++++++++++++++++++++ tests/countries/test_isle_of_man.py | 1 + tests/countries/test_united_kingdom.py | 3 --- 6 files changed, 68 insertions(+), 16 deletions(-) diff --git a/holidays/countries/united_kingdom.py b/holidays/countries/united_kingdom.py index 8ef51bc6a..3822ba18f 100644 --- a/holidays/countries/united_kingdom.py +++ b/holidays/countries/united_kingdom.py @@ -9,7 +9,6 @@ # 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 @@ -110,6 +109,10 @@ def _populate_subdiv_holidays(self): if self._year >= 1975: self._add_observed(self._add_new_years_day("New Year's Day")) + # Whit Monday. + if self._year <= 1970: + self._add_whit_monday("Whit Monday") + # Christmas Day self._add_observed( self._add_christmas_day("Christmas Day"), rule=SAT_SUN_TO_NEXT_MON_TUE @@ -126,10 +129,6 @@ def _populate_subdiv_eng_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") @@ -142,10 +141,6 @@ 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")) @@ -186,10 +181,6 @@ 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") diff --git a/snapshots/countries/GB_COMMON.json b/snapshots/countries/GB_COMMON.json index 7d2acfe3a..81eb6d333 100644 --- a/snapshots/countries/GB_COMMON.json +++ b/snapshots/countries/GB_COMMON.json @@ -1,75 +1,96 @@ { "1950-04-07": "Good Friday", + "1950-05-29": "Whit Monday", "1950-12-25": "Christmas Day", "1950-12-26": "Boxing Day", "1951-03-23": "Good Friday", + "1951-05-14": "Whit Monday", "1951-12-25": "Christmas Day", "1951-12-26": "Boxing Day", "1952-04-11": "Good Friday", + "1952-06-02": "Whit Monday", "1952-12-25": "Christmas Day", "1952-12-26": "Boxing Day", "1953-04-03": "Good Friday", + "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-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-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-05-21": "Whit Monday", "1956-12-25": "Christmas Day", "1956-12-26": "Boxing Day", "1957-04-19": "Good Friday", + "1957-06-10": "Whit Monday", "1957-12-25": "Christmas Day", "1957-12-26": "Boxing Day", "1958-04-04": "Good Friday", + "1958-05-26": "Whit Monday", "1958-12-25": "Christmas Day", "1958-12-26": "Boxing Day", "1959-03-27": "Good Friday", + "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-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-05-22": "Whit Monday", "1961-12-25": "Christmas Day", "1961-12-26": "Boxing Day", "1962-04-20": "Good Friday", + "1962-06-11": "Whit Monday", "1962-12-25": "Christmas Day", "1962-12-26": "Boxing Day", "1963-04-12": "Good Friday", + "1963-06-03": "Whit Monday", "1963-12-25": "Christmas Day", "1963-12-26": "Boxing Day", "1964-03-27": "Good Friday", + "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-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-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-05-15": "Whit Monday", "1967-12-25": "Christmas Day", "1967-12-26": "Boxing Day", "1968-04-12": "Good Friday", + "1968-06-03": "Whit Monday", "1968-12-25": "Christmas Day", "1968-12-26": "Boxing Day", "1969-04-04": "Good Friday", + "1969-05-26": "Whit Monday", "1969-12-25": "Christmas Day", "1969-12-26": "Boxing Day", "1970-03-27": "Good Friday", + "1970-05-18": "Whit Monday", "1970-12-25": "Christmas Day", "1970-12-26": "Boxing Day", "1970-12-28": "Boxing Day (observed)", diff --git a/snapshots/countries/IM_COMMON.json b/snapshots/countries/IM_COMMON.json index 011231682..cf3e2694a 100644 --- a/snapshots/countries/IM_COMMON.json +++ b/snapshots/countries/IM_COMMON.json @@ -1,24 +1,28 @@ { "1950-04-07": "Good Friday", "1950-04-10": "Easter Monday", + "1950-05-29": "Whit Monday", "1950-06-02": "TT Bank Holiday", "1950-07-05": "Tynwald Day", "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-06-01": "TT Bank Holiday", "1951-07-05": "Tynwald Day", "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-06-06": "TT Bank Holiday", "1952-07-05": "Tynwald Day", "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-06-05": "TT Bank Holiday", "1953-07-05": "Tynwald Day", "1953-12-25": "Christmas Day", @@ -27,6 +31,7 @@ "1954-04-16": "Good Friday", "1954-04-19": "Easter Monday", "1954-06-04": "TT Bank Holiday", + "1954-06-07": "Whit Monday", "1954-07-05": "Tynwald Day", "1954-12-25": "Christmas Day", "1954-12-26": "Boxing Day", @@ -34,6 +39,7 @@ "1954-12-28": "Boxing Day (observed)", "1955-04-08": "Good Friday", "1955-04-11": "Easter Monday", + "1955-05-30": "Whit Monday", "1955-06-03": "TT Bank Holiday", "1955-07-05": "Tynwald Day", "1955-12-25": "Christmas Day", @@ -41,6 +47,7 @@ "1955-12-27": "Christmas Day (observed)", "1956-03-30": "Good Friday", "1956-04-02": "Easter Monday", + "1956-05-21": "Whit Monday", "1956-06-01": "TT Bank Holiday", "1956-07-05": "Tynwald Day", "1956-12-25": "Christmas Day", @@ -48,17 +55,20 @@ "1957-04-19": "Good Friday", "1957-04-22": "Easter Monday", "1957-06-07": "TT Bank Holiday", + "1957-06-10": "Whit Monday", "1957-07-05": "Tynwald Day", "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-06-06": "TT Bank Holiday", "1958-07-05": "Tynwald Day", "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-06-05": "TT Bank Holiday", "1959-07-05": "Tynwald Day", "1959-12-25": "Christmas Day", @@ -67,12 +77,14 @@ "1960-04-15": "Good Friday", "1960-04-18": "Easter Monday", "1960-06-03": "TT Bank Holiday", + "1960-06-06": "Whit Monday", "1960-07-05": "Tynwald Day", "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-06-02": "TT Bank Holiday", "1961-07-05": "Tynwald Day", "1961-12-25": "Christmas Day", @@ -80,17 +92,20 @@ "1962-04-20": "Good Friday", "1962-04-23": "Easter Monday", "1962-06-01": "TT Bank Holiday", + "1962-06-11": "Whit Monday", "1962-07-05": "Tynwald Day", "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-06-07": "TT Bank Holiday", "1963-07-05": "Tynwald Day", "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-06-05": "TT Bank Holiday", "1964-07-05": "Tynwald Day", "1964-12-25": "Christmas Day", @@ -99,6 +114,7 @@ "1965-04-16": "Good Friday", "1965-04-19": "Easter Monday", "1965-06-04": "TT Bank Holiday", + "1965-06-07": "Whit Monday", "1965-07-05": "Tynwald Day", "1965-12-25": "Christmas Day", "1965-12-26": "Boxing Day", @@ -106,6 +122,7 @@ "1965-12-28": "Boxing Day (observed)", "1966-04-08": "Good Friday", "1966-04-11": "Easter Monday", + "1966-05-30": "Whit Monday", "1966-06-03": "TT Bank Holiday", "1966-07-05": "Tynwald Day", "1966-12-25": "Christmas Day", @@ -113,24 +130,28 @@ "1966-12-27": "Christmas Day (observed)", "1967-03-24": "Good Friday", "1967-03-27": "Easter Monday", + "1967-05-15": "Whit Monday", "1967-06-02": "TT Bank Holiday", "1967-07-05": "Tynwald Day", "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-06-07": "TT Bank Holiday", "1968-07-05": "Tynwald Day", "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-06-06": "TT Bank Holiday", "1969-07-05": "Tynwald Day", "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-06-05": "TT Bank Holiday", "1970-07-05": "Tynwald Day", "1970-12-25": "Christmas Day", diff --git a/snapshots/countries/UK_COMMON.json b/snapshots/countries/UK_COMMON.json index 7d2acfe3a..81eb6d333 100644 --- a/snapshots/countries/UK_COMMON.json +++ b/snapshots/countries/UK_COMMON.json @@ -1,75 +1,96 @@ { "1950-04-07": "Good Friday", + "1950-05-29": "Whit Monday", "1950-12-25": "Christmas Day", "1950-12-26": "Boxing Day", "1951-03-23": "Good Friday", + "1951-05-14": "Whit Monday", "1951-12-25": "Christmas Day", "1951-12-26": "Boxing Day", "1952-04-11": "Good Friday", + "1952-06-02": "Whit Monday", "1952-12-25": "Christmas Day", "1952-12-26": "Boxing Day", "1953-04-03": "Good Friday", + "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-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-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-05-21": "Whit Monday", "1956-12-25": "Christmas Day", "1956-12-26": "Boxing Day", "1957-04-19": "Good Friday", + "1957-06-10": "Whit Monday", "1957-12-25": "Christmas Day", "1957-12-26": "Boxing Day", "1958-04-04": "Good Friday", + "1958-05-26": "Whit Monday", "1958-12-25": "Christmas Day", "1958-12-26": "Boxing Day", "1959-03-27": "Good Friday", + "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-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-05-22": "Whit Monday", "1961-12-25": "Christmas Day", "1961-12-26": "Boxing Day", "1962-04-20": "Good Friday", + "1962-06-11": "Whit Monday", "1962-12-25": "Christmas Day", "1962-12-26": "Boxing Day", "1963-04-12": "Good Friday", + "1963-06-03": "Whit Monday", "1963-12-25": "Christmas Day", "1963-12-26": "Boxing Day", "1964-03-27": "Good Friday", + "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-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-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-05-15": "Whit Monday", "1967-12-25": "Christmas Day", "1967-12-26": "Boxing Day", "1968-04-12": "Good Friday", + "1968-06-03": "Whit Monday", "1968-12-25": "Christmas Day", "1968-12-26": "Boxing Day", "1969-04-04": "Good Friday", + "1969-05-26": "Whit Monday", "1969-12-25": "Christmas Day", "1969-12-26": "Boxing Day", "1970-03-27": "Good Friday", + "1970-05-18": "Whit Monday", "1970-12-25": "Christmas Day", "1970-12-26": "Boxing Day", "1970-12-28": "Boxing Day (observed)", diff --git a/tests/countries/test_isle_of_man.py b/tests/countries/test_isle_of_man.py index 66dd3ce61..cfd493f1d 100644 --- a/tests/countries/test_isle_of_man.py +++ b/tests/countries/test_isle_of_man.py @@ -28,6 +28,7 @@ def test_1970(self): IsleOfMan(years=1970), ("1970-03-27", "Good Friday"), ("1970-03-30", "Easter Monday"), + ("1970-05-18", "Whit Monday"), ("1970-06-05", "TT Bank Holiday"), ("1970-07-05", "Tynwald Day"), ("1970-12-25", "Christmas Day"), diff --git a/tests/countries/test_united_kingdom.py b/tests/countries/test_united_kingdom.py index 94b2ffd68..8a2e68944 100644 --- a/tests/countries/test_united_kingdom.py +++ b/tests/countries/test_united_kingdom.py @@ -250,9 +250,6 @@ def test_whit_monday(self): self.assertNoHoliday(self.subdiv_holidays[subdiv], dt) self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1950, 2050)) - self.assertNoHoliday(dt) - self.assertNoHolidayName(name, range(1950, 2050)) - def test_spring_bank_holiday(self): name = "Spring Bank Holiday" self.assertHolidayName( From 8e8d40ca21d21e98749eda372ef804bf4ce0e352 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Sat, 27 Jan 2024 18:29:04 +0700 Subject: [PATCH 4/4] [GB] move Whit Monday to per-subdiv declaration basis --- holidays/countries/isle_of_man.py | 4 ++++ holidays/countries/united_kingdom.py | 16 ++++++++++++---- snapshots/countries/GB_COMMON.json | 21 --------------------- snapshots/countries/UK_COMMON.json | 21 --------------------- 4 files changed, 16 insertions(+), 46 deletions(-) diff --git a/holidays/countries/isle_of_man.py b/holidays/countries/isle_of_man.py index 6e403ecba..9779d4ff6 100644 --- a/holidays/countries/isle_of_man.py +++ b/holidays/countries/isle_of_man.py @@ -35,6 +35,10 @@ def _populate_public_holidays(self) -> None: # 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") diff --git a/holidays/countries/united_kingdom.py b/holidays/countries/united_kingdom.py index 3822ba18f..62d70cc5d 100644 --- a/holidays/countries/united_kingdom.py +++ b/holidays/countries/united_kingdom.py @@ -109,10 +109,6 @@ def _populate_subdiv_holidays(self): if self._year >= 1975: self._add_observed(self._add_new_years_day("New Year's Day")) - # Whit Monday. - if self._year <= 1970: - self._add_whit_monday("Whit Monday") - # Christmas Day self._add_observed( self._add_christmas_day("Christmas Day"), rule=SAT_SUN_TO_NEXT_MON_TUE @@ -129,6 +125,10 @@ def _populate_subdiv_eng_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") @@ -141,6 +141,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")) @@ -181,6 +185,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") diff --git a/snapshots/countries/GB_COMMON.json b/snapshots/countries/GB_COMMON.json index 81eb6d333..7d2acfe3a 100644 --- a/snapshots/countries/GB_COMMON.json +++ b/snapshots/countries/GB_COMMON.json @@ -1,96 +1,75 @@ { "1950-04-07": "Good Friday", - "1950-05-29": "Whit Monday", "1950-12-25": "Christmas Day", "1950-12-26": "Boxing Day", "1951-03-23": "Good Friday", - "1951-05-14": "Whit Monday", "1951-12-25": "Christmas Day", "1951-12-26": "Boxing Day", "1952-04-11": "Good Friday", - "1952-06-02": "Whit Monday", "1952-12-25": "Christmas Day", "1952-12-26": "Boxing Day", "1953-04-03": "Good Friday", - "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-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-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-05-21": "Whit Monday", "1956-12-25": "Christmas Day", "1956-12-26": "Boxing Day", "1957-04-19": "Good Friday", - "1957-06-10": "Whit Monday", "1957-12-25": "Christmas Day", "1957-12-26": "Boxing Day", "1958-04-04": "Good Friday", - "1958-05-26": "Whit Monday", "1958-12-25": "Christmas Day", "1958-12-26": "Boxing Day", "1959-03-27": "Good Friday", - "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-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-05-22": "Whit Monday", "1961-12-25": "Christmas Day", "1961-12-26": "Boxing Day", "1962-04-20": "Good Friday", - "1962-06-11": "Whit Monday", "1962-12-25": "Christmas Day", "1962-12-26": "Boxing Day", "1963-04-12": "Good Friday", - "1963-06-03": "Whit Monday", "1963-12-25": "Christmas Day", "1963-12-26": "Boxing Day", "1964-03-27": "Good Friday", - "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-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-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-05-15": "Whit Monday", "1967-12-25": "Christmas Day", "1967-12-26": "Boxing Day", "1968-04-12": "Good Friday", - "1968-06-03": "Whit Monday", "1968-12-25": "Christmas Day", "1968-12-26": "Boxing Day", "1969-04-04": "Good Friday", - "1969-05-26": "Whit Monday", "1969-12-25": "Christmas Day", "1969-12-26": "Boxing Day", "1970-03-27": "Good Friday", - "1970-05-18": "Whit Monday", "1970-12-25": "Christmas Day", "1970-12-26": "Boxing Day", "1970-12-28": "Boxing Day (observed)", diff --git a/snapshots/countries/UK_COMMON.json b/snapshots/countries/UK_COMMON.json index 81eb6d333..7d2acfe3a 100644 --- a/snapshots/countries/UK_COMMON.json +++ b/snapshots/countries/UK_COMMON.json @@ -1,96 +1,75 @@ { "1950-04-07": "Good Friday", - "1950-05-29": "Whit Monday", "1950-12-25": "Christmas Day", "1950-12-26": "Boxing Day", "1951-03-23": "Good Friday", - "1951-05-14": "Whit Monday", "1951-12-25": "Christmas Day", "1951-12-26": "Boxing Day", "1952-04-11": "Good Friday", - "1952-06-02": "Whit Monday", "1952-12-25": "Christmas Day", "1952-12-26": "Boxing Day", "1953-04-03": "Good Friday", - "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-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-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-05-21": "Whit Monday", "1956-12-25": "Christmas Day", "1956-12-26": "Boxing Day", "1957-04-19": "Good Friday", - "1957-06-10": "Whit Monday", "1957-12-25": "Christmas Day", "1957-12-26": "Boxing Day", "1958-04-04": "Good Friday", - "1958-05-26": "Whit Monday", "1958-12-25": "Christmas Day", "1958-12-26": "Boxing Day", "1959-03-27": "Good Friday", - "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-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-05-22": "Whit Monday", "1961-12-25": "Christmas Day", "1961-12-26": "Boxing Day", "1962-04-20": "Good Friday", - "1962-06-11": "Whit Monday", "1962-12-25": "Christmas Day", "1962-12-26": "Boxing Day", "1963-04-12": "Good Friday", - "1963-06-03": "Whit Monday", "1963-12-25": "Christmas Day", "1963-12-26": "Boxing Day", "1964-03-27": "Good Friday", - "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-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-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-05-15": "Whit Monday", "1967-12-25": "Christmas Day", "1967-12-26": "Boxing Day", "1968-04-12": "Good Friday", - "1968-06-03": "Whit Monday", "1968-12-25": "Christmas Day", "1968-12-26": "Boxing Day", "1969-04-04": "Good Friday", - "1969-05-26": "Whit Monday", "1969-12-25": "Christmas Day", "1969-12-26": "Boxing Day", "1970-03-27": "Good Friday", - "1970-05-18": "Whit Monday", "1970-12-25": "Christmas Day", "1970-12-26": "Boxing Day", "1970-12-28": "Boxing Day (observed)",