Skip to content

Commit 993b7d8

Browse files
Wasif-ShahzadKJhellicoarkid15r
authored
Add Montserrat holidays (#2714)
Co-authored-by: ~Jhellico <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]>
1 parent 153eafa commit 993b7d8

File tree

9 files changed

+624
-3
lines changed

9 files changed

+624
-3
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ and detailed information.
105105

106106
## Available Countries
107107

108-
We currently support 212 country codes. The standard way to refer to a country is by using its [ISO
108+
We currently support 213 country codes. The standard way to refer to a country is by using its [ISO
109109
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
110110
for domain names, and for a subdivision its [ISO 3166-2
111111
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
@@ -1043,6 +1043,13 @@ any) in brackets, available languages and additional holiday categories. All cou
10431043
<td>CATHOLIC, HEBREW, ISLAMIC, ORTHODOX, WORKDAY</td>
10441044
</tr>
10451045
<tr>
1046+
<td>Montserrat</td>
1047+
<td>MS</td>
1048+
<td></td>
1049+
<td><strong>en_MS</strong>, en_US</td>
1050+
<td></td>
1051+
</tr>
1052+
<tr>
10461053
<td>Morocco</td>
10471054
<td>MA</td>
10481055
<td></td>

holidays/countries/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
from holidays.countries.monaco import Monaco, MC, MCO
146146
from holidays.countries.mongolia import Mongolia, MN, MNG
147147
from holidays.countries.montenegro import Montenegro, ME, MNE
148+
from holidays.countries.montserrat import Montserrat, MS, MSR
148149
from holidays.countries.morocco import Morocco, MA, MOR
149150
from holidays.countries.mozambique import Mozambique, MZ, MOZ
150151
from holidays.countries.namibia import Namibia, NA, NAM

holidays/countries/montserrat.py

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# holidays
2+
# --------
3+
# A fast, efficient Python library for generating country, province and state
4+
# specific sets of holidays on the fly. It aims to make determining whether a
5+
# specific date is a holiday as fast and flexible as possible.
6+
#
7+
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
8+
# dr-prodigy <[email protected]> (c) 2017-2023
9+
# ryanss <[email protected]> (c) 2014-2017
10+
# Website: https://github.com/vacanza/holidays
11+
# License: MIT (see LICENSE file)
12+
13+
from gettext import gettext as tr
14+
15+
from holidays.calendars.gregorian import APR, MAY, JUN, JUL, SEP, DEC
16+
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
17+
from holidays.observed_holiday_base import (
18+
ObservedHolidayBase,
19+
MON_TO_NEXT_TUE,
20+
SAT_TO_NEXT_MON,
21+
SAT_SUN_TO_NEXT_MON,
22+
SAT_SUN_TO_NEXT_MON_TUE,
23+
)
24+
25+
26+
class Montserrat(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
27+
"""Montserrat holidays.
28+
29+
References:
30+
* <https://en.wikipedia.org/wiki/Public_holidays_in_Montserrat>
31+
* [Public holidays Act, 2017](https://web.archive.org/web/20240619074948/http://agc.gov.ms/wp-content/uploads/2011/10/Act-No.-3-of-2017-Public-Holidays-Amendment-Act-20171.pdf)
32+
* [Public holidays Act, 2019](https://web.archive.org/web/20241025070627/https://www.gov.ms/wp-content/uploads/2020/06/Public-Holidays-Act.pdf)
33+
* [National Day of Prayer and Thanksgiving, 2021](https://web.archive.org/web/20220809144840/https://www.gov.ms/2021/07/16/wednesday-july-21-2021-public-holiday-national-day-of-prayer-thanksgiving/)
34+
* [National Day of Prayer and Thanksgiving, 2022](https://web.archive.org/web/20220816124619/https://www.gov.ms/2022/07/19/public-holiday-for-national-day-of-prayer-and-thanksgiving-to-be-held-on-july-20-2022/)
35+
* [National Day of Prayer and Thanksgiving](https://web.archive.org/web/20240711221313/https://www.gov.ms/wp-content/uploads/2023/05/SRO-No.-15-of-2023-Public-Holidays-Amendment-of-Schedule-Order.pdf)
36+
* [Queen's Platinum Jubilee, 2022](https://web.archive.org/web/20250711160439/https://www.gov.ms/tag/public-holidays/)
37+
* [Montserrat Public holidays, 2022](https://web.archive.org/web/20220809030551/https://www.gov.ms/wp-content/uploads/2021/12/Public-Holidays-2022-1.jpeg)
38+
* [Montserrat Public holidays, 2023](https://web.archive.org/web/20241126232715/https://www.gov.ms/wp-content/uploads/2023/02/Public-Holidays-Montserrat-2023_page-0001.jpg)
39+
* [Montserrat Public holidays, 2024](https://web.archive.org/web/20240421112540/https://www.gov.ms/wp-content/uploads/2023/12/Public-Holidays-Montserrat-2024.docx.pdf)
40+
* [King's Birthday, 2024](https://web.archive.org/web/20250711202228/https://parliament.ms/wp-content/uploads/2024/09/SRO-No.-18-of-2024-PROCOLAMATION-APPOINTING-MONDAY-17-JUNE-2024-AS-A-PUBLIC-HOLIDAY.pdf)
41+
* [Montserrat Public holidays, 2025](https://web.archive.org/web/20250711160324/https://www.gov.ms/wp-content/uploads/2025/01/2025-Public-Holidays-on-Montserrat.pdf)
42+
"""
43+
44+
country = "MS"
45+
default_language = "en_MS"
46+
# %s (observed).
47+
observed_label = "%s (observed)"
48+
# Public holidays Act, 2017.
49+
start_year = 2017
50+
supported_languages = ("en_MS", "en_US")
51+
52+
def __init__(self, *args, **kwargs):
53+
ChristianHolidays.__init__(self)
54+
InternationalHolidays.__init__(self)
55+
StaticHolidays.__init__(self, MontserratStaticHolidays)
56+
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
57+
super().__init__(*args, **kwargs)
58+
59+
def _populate_public_holidays(self):
60+
self._add_observed(
61+
# New Year's Day.
62+
self._add_new_years_day(tr("New Year's Day")),
63+
rule=SAT_SUN_TO_NEXT_MON_TUE + MON_TO_NEXT_TUE,
64+
)
65+
66+
# Saint Patrick's Day.
67+
self._add_observed(self._add_holiday_mar_17(tr("Saint Patrick's Day")))
68+
69+
# Good Friday.
70+
self._add_good_friday(tr("Good Friday"))
71+
72+
# Easter Monday.
73+
self._add_easter_monday(tr("Easter Monday"))
74+
75+
# Labor Day.
76+
self._add_holiday_1st_mon_of_may(tr("Labour Day"))
77+
78+
name = (
79+
# King's Birthday.
80+
tr("King's Birthday")
81+
if self._year >= 2023
82+
# Queen's Birthday.
83+
else tr("Queen's Birthday")
84+
)
85+
sovereign_birthday_dts = {
86+
2022: (JUN, 2),
87+
2023: (JUN, 19),
88+
2024: (JUN, 17),
89+
}
90+
sovereign_birthday_dt = (
91+
self._add_holiday(name, dt)
92+
if (dt := sovereign_birthday_dts.get(self._year))
93+
else self._add_holiday_2_days_past_2nd_sat_of_jun(name)
94+
)
95+
96+
# Whit Monday.
97+
name = tr("Whit Monday")
98+
whit_monday_dt = self._add_whit_monday(name)
99+
if whit_monday_dt == sovereign_birthday_dt:
100+
self._add_observed(whit_monday_dt, name=name, rule=MON_TO_NEXT_TUE)
101+
102+
if self._year >= 2021:
103+
day_of_prayer_dts = {
104+
2021: (JUL, 21),
105+
2022: (JUL, 20),
106+
}
107+
name = (
108+
# National Day of Prayer and Thanksgiving.
109+
tr("National Day of Prayer and Thanksgiving")
110+
if self._year <= 2023
111+
# Day of Prayer and Thanksgiving.
112+
else tr("Day of Prayer and Thanksgiving")
113+
)
114+
if dt := day_of_prayer_dts.get(self._year):
115+
self._add_holiday(name, dt)
116+
else:
117+
self._add_holiday_2nd_wed_of_jul(name)
118+
119+
# Emancipation Day.
120+
self._add_holiday_1st_mon_of_aug(tr("Emancipation Day"))
121+
122+
self._add_observed(
123+
# Christmas Day.
124+
self._add_christmas_day(tr("Christmas Day")),
125+
rule=SAT_SUN_TO_NEXT_MON_TUE,
126+
)
127+
128+
self._add_observed(
129+
# Boxing Day.
130+
self._add_christmas_day_two(tr("Boxing Day")),
131+
rule=SAT_SUN_TO_NEXT_MON_TUE,
132+
)
133+
134+
# Festival Day.
135+
name = tr("Festival Day")
136+
self._add_new_years_eve(name)
137+
self._add_observed((self._year - 1, DEC, 31), name, rule=SAT_TO_NEXT_MON)
138+
139+
140+
class MS(Montserrat):
141+
pass
142+
143+
144+
class MSR(Montserrat):
145+
pass
146+
147+
148+
class MontserratStaticHolidays(StaticHolidays):
149+
"""Montserrat special holidays.
150+
151+
References:
152+
* [September 14th, 2018](https://web.archive.org/web/20220810224300/https://www.gov.ms/wp-content/uploads/2020/11/SRO.-No.-35-of-2018-Proclamation-Declaring-Friday-14-September-2018-as-a-public-holiday.pdf)
153+
* [May 10th, 2019](https://web.archive.org/web/20240626113529/https://parliament.ms/wp-content/uploads/2022/02/SRO-No-13-of-2019-Proclamation-Declaring-Friday-10-May-2019-as-a-publi._.pdf)
154+
* [July 15th, 2020](https://web.archive.org/web/20220810225456/https://www.gov.ms/wp-content/uploads/2020/08/SRO.-No.-40-of-2020-Proclamation-Declaring-Wednesday-15-July-2020-as-a-Public-Holiday.pdf)
155+
* [National Day of Mourning](https://web.archive.org/web/20240617072858/https://www.parliament.ms/wp-content/uploads/2022/09/SRO-No.43-of-2022-Proclamation-Appointing-Monday-19-September-2022-a-Public-Holiday.pdf)
156+
* [Coronation of King Charles III](https://web.archive.org/web/20241126232715/https://www.gov.ms/wp-content/uploads/2023/02/Public-Holidays-Montserrat-2023_page-0001.jpg)
157+
"""
158+
159+
# Special Public Holiday.
160+
name = tr("Special Public Holiday")
161+
162+
special_public_holidays = {
163+
2018: (SEP, 14, name),
164+
2019: (MAY, 10, name),
165+
2020: (JUL, 15, name),
166+
2022: (
167+
# Platinum Jubilee of Elizabeth II.
168+
(JUN, 3, tr("Platinum Jubilee of Elizabeth II")),
169+
# National Day of Mourning.
170+
(SEP, 19, tr("National Day of Mourning")),
171+
),
172+
2023: (
173+
(APR, 12, name),
174+
# Coronation of King Charles III.
175+
(MAY, 6, tr("Coronation of King Charles III")),
176+
),
177+
}

holidays/holiday_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from holidays.helpers import _normalize_arguments, _normalize_tuple
4545

4646
CategoryArg = Union[str, Iterable[str]]
47-
DateArg = Union[date, tuple[int, int]]
47+
DateArg = Union[date, tuple[int, int], tuple[int, int, int]]
4848
DateLike = Union[date, datetime, str, float, int]
4949
SpecialHoliday = Union[tuple[int, int, str], tuple[tuple[int, int, str], ...]]
5050
SubstitutedHoliday = Union[
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# holidays
2+
# --------
3+
# A fast, efficient Python library for generating country, province and state
4+
# specific sets of holidays on the fly. It aims to make determining whether a
5+
# specific date is a holiday as fast and flexible as possible.
6+
#
7+
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
8+
# dr-prodigy <[email protected]> (c) 2017-2023
9+
# ryanss <[email protected]> (c) 2014-2017
10+
# Website: https://github.com/vacanza/holidays
11+
# License: MIT (see LICENSE file)
12+
#
13+
# Montserrat holidays.
14+
#
15+
msgid ""
16+
msgstr ""
17+
"Project-Id-Version: Holidays 0.77\n"
18+
"POT-Creation-Date: 2025-07-11 06:02+0500\n"
19+
"PO-Revision-Date: 2025-07-11 06:02+0500\n"
20+
"Last-Translator: Wasif Shahzad <[email protected]>\n"
21+
"Language-Team: Holidays Localization Team\n"
22+
"Language: en_MS\n"
23+
"MIME-Version: 1.0\n"
24+
"Content-Type: text/plain; charset=UTF-8\n"
25+
"Content-Transfer-Encoding: 8bit\n"
26+
"Generated-By: Lingva 5.0.6\n"
27+
"X-Source-Language: en_MS\n"
28+
29+
#. New Year's Day.
30+
msgid "New Year's Day"
31+
msgstr ""
32+
33+
#. Saint Patrick's Day.
34+
msgid "Saint Patrick's Day"
35+
msgstr ""
36+
37+
#. Good Friday.
38+
msgid "Good Friday"
39+
msgstr ""
40+
41+
#. Easter Monday.
42+
msgid "Easter Monday"
43+
msgstr ""
44+
45+
#. Labor Day.
46+
msgid "Labour Day"
47+
msgstr ""
48+
49+
#. King's Birthday.
50+
msgid "King's Birthday"
51+
msgstr ""
52+
53+
#. Queen's Birthday.
54+
msgid "Queen's Birthday"
55+
msgstr ""
56+
57+
#. Whit Monday.
58+
msgid "Whit Monday"
59+
msgstr ""
60+
61+
#. National Day of Prayer and Thanksgiving.
62+
msgid "National Day of Prayer and Thanksgiving"
63+
msgstr ""
64+
65+
#. Day of Prayer and Thanksgiving.
66+
msgid "Day of Prayer and Thanksgiving"
67+
msgstr ""
68+
69+
#. Emancipation Day.
70+
msgid "Emancipation Day"
71+
msgstr ""
72+
73+
#. Christmas Day.
74+
msgid "Christmas Day"
75+
msgstr ""
76+
77+
#. Boxing Day.
78+
msgid "Boxing Day"
79+
msgstr ""
80+
81+
#. Festival Day.
82+
msgid "Festival Day"
83+
msgstr ""
84+
85+
#. Special Public Holiday.
86+
msgid "Special Public Holiday"
87+
msgstr ""
88+
89+
#. Platinum Jubilee of Elizabeth II.
90+
msgid "Platinum Jubilee of Elizabeth II"
91+
msgstr ""
92+
93+
#. National Day of Mourning.
94+
msgid "National Day of Mourning"
95+
msgstr ""
96+
97+
#. Coronation of King Charles III.
98+
msgid "Coronation of King Charles III"
99+
msgstr ""

0 commit comments

Comments
 (0)