+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ and detailed information.

## Available Countries

We currently support 202 country codes. The standard way to refer to a country is by using its [ISO
We currently support 203 country codes. The standard way to refer to a country is by using its [ISO
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
for domain names, and for a subdivision its [ISO 3166-2
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
Expand Down Expand Up @@ -952,6 +952,13 @@ any) in brackets, available languages and additional holiday categories. All cou
<td></td>
</tr>
<tr>
<td>Mauritius</td>
<td>MU</td>
<td></td>
<td><strong>en_MU</strong>, en_US</td>
<td></td>
</tr>
<tr>
<td>Mayotte</td>
<td>YT</td>
<td>Can also be loaded as country FR, subdivision 976</td>
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
from holidays.countries.marshall_islands import MarshallIslands, MH, MHL, HolidaysMH
from holidays.countries.martinique import Martinique, MQ, MTQ, HolidaysMQ
from holidays.countries.mauritania import Mauritania, MR, MRT
from holidays.countries.mauritius import Mauritius, MU, MUS
from holidays.countries.mayotte import Mayotte, YT, MYT, HolidaysYT
from holidays.countries.mexico import Mexico, MX, MEX
from holidays.countries.micronesia import Micronesia, FM, FSM
Expand Down
197 changes: 197 additions & 0 deletions holidays/countries/mauritius.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from gettext import gettext as tr

from holidays.calendars import _CustomHinduHolidays, _CustomIslamicHolidays
from holidays.calendars.gregorian import JAN, FEB, APR, MAY, JUN, JUL, AUG, SEP
from holidays.groups import (
ChineseCalendarHolidays,
ChristianHolidays,
HinduCalendarHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
)
from holidays.holiday_base import HolidayBase


class Mauritius(
HolidayBase,
ChineseCalendarHolidays,
ChristianHolidays,
HinduCalendarHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
):
"""Mauritius holidays.

References:
* [Public Holidays Act Consolidated 1991](https://web.archive.org/web/20250618211720/https://natlex.ilo.org/dyn/natlex2/natlex2/files/download/101480/MUS101480.pdf)
* [The Public Holidays (Amendment) Act 2015](https://web.archive.org/web/20240805131941/http://mauritiusassembly.govmu.org/mauritiusassembly/wp-content/uploads/2023/03/act2815.pdf)
* Mauritius became independent in 1968, but the earliest accessible version of the Public
Holidays Act is the one consolidated in 1991. The most recent update to the holiday
schedule reflected in that version dates back to 1987. Therefore, 1988 is being used
as the starting year.
* [Ougadi](https://en.wikipedia.org/wiki/Ugadi) is another name for the Telugu holiday,
Ugadi, which is celebrated on the same day as Gudi Padwa. Therefore, reusing Gudi Padwa
for adding Ougadi.
* [2021](https://web.archive.org/web/20210926053030/https://mauritius-paris.govmu.org/Pages/About%20Us/Public-Holidays-in-Mauritius-for-Year-2021.aspx)
* [2022](https://web.archive.org/web/20240703234017/https://mauritius-kualalumpur.govmu.org/Documents/Public%20Holiday/Public%20holidays%20-%202022.pdf)
* [2024](https://web.archive.org/web/20240703233951/https://mauritius-paris.govmu.org/Documents/Public%20Holidays/Notice%20-%20Final%20Public%20holidays%20-%202024.pdf)
* [2025](https://web.archive.org/web/20250113100149/https://pmo.govmu.org/Communique/Notice-Public_Holidays_2025.pdf)
"""

country = "MU"
default_language = "en_MU"
# %s (estimated).
estimated_label = tr("%s (estimated)")
start_year = 1988
supported_languages = ("en_MU", "en_US")

def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
"""
Args:
islamic_show_estimated:
Whether to add "estimated" label to Islamic holidays name
if holiday date is estimated.
"""
ChineseCalendarHolidays.__init__(self)
ChristianHolidays.__init__(self)
HinduCalendarHolidays.__init__(self, cls=MauritiusHinduHolidays)
InternationalHolidays.__init__(self)
IslamicHolidays.__init__(
self, cls=MauritiusIslamicHolidays, show_estimated=islamic_show_estimated
)
StaticHolidays.__init__(self, cls=MauritiusStaticHolidays)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# New Year's Day.
self._add_new_years_day(tr("New Year's Day"))

# Day after New Year's Day.
self._add_new_years_day_two(tr("Day after New Year's Day"))

# Abolition of Slavery.
self._add_holiday_feb_1(tr("Abolition of Slavery"))

# Independence and Republic Day.
self._add_holiday_mar_12(tr("Independence and Republic Day"))

# Labor Day.
self._add_labor_day(tr("Labour Day"))

if self._year >= 2016 and self._year % 2 == 0:
# Assumption Day.
self._add_assumption_of_mary_day(tr("Assumption of the Blessed Virgin Mary"))

if self._year <= 2015 or self._year % 2 != 0:
# All Saints' Day.
self._add_all_saints_day(tr("All Saints' Day"))

# Arrival of Indentured Laborers.
self._add_holiday_nov_2(tr("Arrival of Indentured Labourers"))

# Christmas Day.
self._add_christmas_day(tr("Christmas Day"))

# Chinese Spring Festival.
self._add_chinese_new_years_day(tr("Chinese Spring Festival"))

# Eid al-Fitr.
self._add_eid_al_fitr_day(tr("Eid-ul-Fitr"))

# Thaipusam.
self._add_thaipusam(tr("Thaipoosam Cavadee"))

# Maha Shivaratri.
self._add_maha_shivaratri(tr("Maha Shivaratree"))

# Ugadi.
self._add_gudi_padwa(tr("Ougadi"))

# Ganesh Chaturthi.
self._add_ganesh_chaturthi(tr("Ganesh Chaturthi"))

# Diwali.
self._add_diwali_india(tr("Divali"))


class MU(Mauritius):
pass


class MUS(Mauritius):
pass


class MauritiusHinduHolidays(_CustomHinduHolidays):
# https://web.archive.org/web/20241208154454/https://www.timeanddate.com/holidays/mauritius/ganesh-chaturthi
GANESH_CHATURTHI_DATES = {
2015: (SEP, 18),
2016: (SEP, 6),
2017: (AUG, 25),
2018: (SEP, 14),
2019: (SEP, 3),
2020: (AUG, 23),
2021: (SEP, 11),
2022: (SEP, 1),
2023: (SEP, 20),
2024: (SEP, 8),
2025: (AUG, 28),
}

# https://web.archive.org/web/20240910225221/https://www.timeanddate.com/holidays/mauritius/thaipoosam-cavadee
THAIPUSAM_DATES = {
2020: (FEB, 8),
2021: (JAN, 28),
2022: (JAN, 18),
2023: (FEB, 4),
2024: (JAN, 25),
2025: (FEB, 11),
}


class MauritiusIslamicHolidays(_CustomIslamicHolidays):
# https://web.archive.org/web/20250420201326/https://www.timeanddate.com/holidays/mauritius/eid-al-fitr
EID_AL_FITR_DATES = {
2016: (JUL, 6),
2017: (JUN, 26),
2018: (JUN, 16),
2019: (JUN, 5),
2020: (MAY, 24),
2021: (MAY, 14),
2022: (MAY, 3),
2023: (APR, 22),
2024: (APR, 11),
2025: (APR, 1),
}


class MauritiusStaticHolidays(StaticHolidays):
"""Mauritius special holidays.

References:
* [July 29, 2019 and September 9, 2019](https://web.archive.org/web/20250618211631/https://mauritiuslii.org/akn/mu/officialGazette/government-gazette/2019-07-27/78/eng@2019-07-27)
"""

# Public Holiday.
public_holiday = tr("Public Holiday")

special_public_holidays = {
2019: (
(JUL, 29, public_holiday),
(SEP, 9, public_holiday),
)
}
100 changes: 100 additions & 0 deletions holidays/locale/en_MU/LC_MESSAGES/MU.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# Mauritius holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.76\n"
"POT-Creation-Date: 2025-06-15 18:34+0530\n"
"PO-Revision-Date: 2025-06-15 18:34+0530\n"
"Last-Translator: Kriti Birda <workwithkritibirda@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_MU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.6\n"
"X-Source-Language: en_MU\n"

#. %s (estimated).
#, c-format
msgid "%s (estimated)"
msgstr ""

#. New Year's Day.
msgid "New Year's Day"
msgstr ""

#. Day after New Year's Day.
msgid "Day after New Year's Day"
msgstr ""

#. Abolition of Slavery.
msgid "Abolition of Slavery"
msgstr ""

#. Independence and Republic Day.
msgid "Independence and Republic Day"
msgstr ""

#. Labor Day.
msgid "Labour Day"
msgstr ""

#. Arrival of Indentured Laborers.
msgid "Arrival of Indentured Labourers"
msgstr ""

#. All Saints' Day.
msgid "All Saints' Day"
msgstr ""

#. Assumption Day.
msgid "Assumption of the Blessed Virgin Mary"
msgstr ""

#. Christmas Day.
msgid "Christmas Day"
msgstr ""

#. Chinese Spring Festival.
msgid "Chinese Spring Festival"
msgstr ""

#. Eid al-Fitr.
msgid "Eid-ul-Fitr"
msgstr ""

#. Thaipusam.
msgid "Thaipoosam Cavadee"
msgstr ""

#. Maha Shivaratri.
msgid "Maha Shivaratree"
msgstr ""

#. Ugadi.
msgid "Ougadi"
msgstr ""

#. Ganesh Chaturthi.
msgid "Ganesh Chaturthi"
msgstr ""

#. Diwali.
msgid "Divali"
msgstr ""

#. Public Holiday.
msgid "Public Holiday"
msgstr ""
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载