Skip to content

Commit

Permalink
Add Maldives holidays (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasya authored Oct 16, 2023
1 parent 3f8f47b commit 6fbabfc
Show file tree
Hide file tree
Showing 9 changed files with 2,368 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Available Countries
.. _ISO 639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _ISO 639-2 code: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

We currently support 136 country codes. The standard way to refer to a country
We currently support 137 country codes. The standard way to refer to a country
is by using its `ISO 3166-1 alpha-2 code`_, the same used for domain names, and
for a subdivision its `ISO 3166-2 code`_. Some of the countries support more
than one language for holiday names output.
Expand Down Expand Up @@ -547,6 +547,11 @@ The list of supported countries, their subdivisions, supported languages and cat
- States: JHR, KDH, KTN, KUL, LBN, MLK, NSN, PHG, PJY, PLS, PNG, PRK, SBH, SGR, SWK, TRG
-
-
* - Maldives
- MV
-
-
-
* - Malta
- MT
-
Expand Down
322 changes: 322 additions & 0 deletions holidays/calendars/islamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
HIJRI_NEW_YEAR = "HIJRI_NEW_YEAR"
IMAM_MAHDI_BIRTHDAY = "IMAM_MAHDI_BIRTHDAY"
ISRA_AND_MIRAJ = "ISRA_AND_MIRAJ"
MALDIVES_EMBRACED_ISLAM_DAY = "MALDIVES_EMBRACED_ISLAM_DAY"
MAWLID = "MAWLID"
NUZUL_AL_QURAN = "NUZUL_AL_QURAN"
PROPHET_DEATH = "PROPHET_DEATH"
QUAMEE_DHUVAS = "QUAMEE_DHUVAS"
RAMADAN_BEGINNING = "RAMADAN_BEGINNING"
SADIQ_BIRTHDAY = "SADIQ_BIRTHDAY"
SADIQ_DEATH = "SADIQ_DEATH"
Expand Down Expand Up @@ -2229,6 +2231,163 @@ class _IslamicLunar:
2077: (JUN, 18),
}

MALDIVES_EMBRACED_ISLAM_DAY_DATES = {
1924: (OCT, 29),
1925: (OCT, 19),
1926: (OCT, 8),
1927: (SEP, 27),
1928: (SEP, 15),
1929: (SEP, 5),
1930: (AUG, 25),
1931: (AUG, 15),
1932: (AUG, 4),
1933: (JUL, 24),
1934: (JUL, 13),
1935: (JUL, 2),
1936: (JUN, 21),
1937: (JUN, 10),
1938: (MAY, 30),
1939: (MAY, 20),
1940: (MAY, 9),
1941: (APR, 27),
1942: (APR, 17),
1943: (APR, 6),
1944: (MAR, 25),
1945: (MAR, 15),
1946: (MAR, 4),
1947: (FEB, 22),
1948: (FEB, 11),
1949: (JAN, 30),
1950: (JAN, 20),
1951: ((JAN, 10), (DEC, 30)),
1952: (DEC, 18),
1953: (DEC, 7),
1954: (NOV, 27),
1955: (NOV, 17),
1956: (NOV, 4),
1957: (OCT, 24),
1958: (OCT, 15),
1959: (OCT, 3),
1960: (SEP, 22),
1961: (SEP, 11),
1962: (AUG, 31),
1963: (AUG, 20),
1964: (AUG, 9),
1965: (JUL, 29),
1966: (JUL, 19),
1967: (JUL, 8),
1968: (JUN, 27),
1969: (JUN, 16),
1970: (JUN, 6),
1971: (MAY, 26),
1972: (MAY, 14),
1973: (MAY, 4),
1974: (APR, 23),
1975: (APR, 12),
1976: (MAR, 31),
1977: (MAR, 20),
1978: (MAR, 10),
1979: (FEB, 27),
1980: (FEB, 17),
1981: (FEB, 5),
1982: (JAN, 26),
1983: (JAN, 15),
1984: ((JAN, 4), (DEC, 23)),
1985: (DEC, 13),
1986: (DEC, 2),
1987: (NOV, 22),
1988: (NOV, 10),
1989: (OCT, 30),
1990: (OCT, 19),
1991: (OCT, 8),
1992: (SEP, 27),
1993: (SEP, 17),
1994: (SEP, 6),
1995: (AUG, 27),
1996: (AUG, 15),
1997: (AUG, 4),
1998: (JUL, 24),
1999: (JUL, 14),
2000: (JUL, 3),
2001: (JUN, 22),
2002: (JUN, 12),
2003: (JUN, 1),
2004: (MAY, 20),
2005: (MAY, 9),
2006: (APR, 29),
2007: (APR, 18),
2008: (APR, 7),
2009: (MAR, 28),
2010: (MAR, 17),
2011: (MAR, 6),
2012: (FEB, 23),
2013: (FEB, 11),
2014: (FEB, 1),
2015: (JAN, 21),
2016: ((JAN, 11), (DEC, 30)),
2017: (DEC, 19),
2018: (DEC, 8),
2019: (NOV, 28),
2020: (NOV, 16),
2021: (NOV, 6),
2022: (OCT, 26),
2023: (OCT, 16),
2024: (OCT, 4),
2025: (SEP, 23),
2026: (SEP, 12),
2027: (SEP, 2),
2028: (AUG, 22),
2029: (AUG, 11),
2030: (AUG, 1),
2031: (JUL, 21),
2032: (JUL, 9),
2033: (JUN, 28),
2034: (JUN, 17),
2035: (JUN, 7),
2036: (MAY, 27),
2037: (MAY, 16),
2038: (MAY, 5),
2039: (APR, 24),
2040: (APR, 13),
2041: (APR, 2),
2042: (MAR, 23),
2043: (MAR, 12),
2044: (MAR, 1),
2045: (FEB, 18),
2046: (FEB, 7),
2047: (JAN, 27),
2048: (JAN, 16),
2049: ((JAN, 5), (DEC, 26)),
2050: (DEC, 15),
2051: (DEC, 4),
2052: (NOV, 22),
2053: (NOV, 11),
2054: (NOV, 1),
2055: (OCT, 21),
2056: (OCT, 10),
2057: (SEP, 30),
2058: (SEP, 19),
2059: (SEP, 8),
2060: (AUG, 27),
2061: (AUG, 16),
2062: (AUG, 6),
2063: (JUL, 27),
2064: (JUL, 15),
2065: (JUL, 5),
2066: (JUN, 24),
2067: (JUN, 13),
2068: (JUN, 1),
2069: (MAY, 22),
2070: (MAY, 11),
2071: (MAY, 1),
2072: (APR, 19),
2073: (APR, 9),
2074: (MAR, 29),
2075: (MAR, 18),
2076: (MAR, 6),
2077: (FEB, 24),
}

MAWLID_DATES = {
1924: (OCT, 10),
1925: (SEP, 30),
Expand Down Expand Up @@ -2699,6 +2858,163 @@ class _IslamicLunar:
2077: (JAN, 23),
}

QUAMEE_DHUVAS_DATES = {
1924: (SEP, 29),
1925: (SEP, 19),
1926: (SEP, 8),
1927: (AUG, 28),
1928: (AUG, 16),
1929: (AUG, 6),
1930: (JUL, 26),
1931: (JUL, 17),
1932: (JUL, 5),
1933: (JUN, 24),
1934: (JUN, 13),
1935: (JUN, 3),
1936: (MAY, 22),
1937: (MAY, 11),
1938: (APR, 30),
1939: (APR, 21),
1940: (APR, 9),
1941: (MAR, 28),
1942: (MAR, 18),
1943: (MAR, 7),
1944: (FEB, 24),
1945: (FEB, 13),
1946: (FEB, 2),
1947: (JAN, 23),
1948: ((JAN, 12), (DEC, 31)),
1949: (DEC, 21),
1950: (DEC, 11),
1951: (NOV, 30),
1952: (NOV, 19),
1953: (NOV, 8),
1954: (OCT, 28),
1955: (OCT, 18),
1956: (OCT, 6),
1957: (SEP, 25),
1958: (SEP, 15),
1959: (SEP, 4),
1960: (AUG, 23),
1961: (AUG, 12),
1962: (AUG, 1),
1963: (JUL, 22),
1964: (JUL, 10),
1965: (JUN, 29),
1966: (JUN, 20),
1967: (JUN, 8),
1968: (MAY, 28),
1969: (MAY, 17),
1970: (MAY, 7),
1971: (APR, 26),
1972: (APR, 14),
1973: (APR, 4),
1974: (MAR, 24),
1975: (MAR, 13),
1976: (MAR, 1),
1977: (FEB, 19),
1978: (FEB, 8),
1979: (JAN, 29),
1980: (JAN, 19),
1981: ((JAN, 7), (DEC, 27)),
1982: (DEC, 16),
1983: (DEC, 5),
1984: (NOV, 23),
1985: (NOV, 13),
1986: (NOV, 3),
1987: (OCT, 23),
1988: (OCT, 11),
1989: (SEP, 30),
1990: (SEP, 20),
1991: (SEP, 9),
1992: (AUG, 29),
1993: (AUG, 18),
1994: (AUG, 8),
1995: (JUL, 28),
1996: (JUL, 16),
1997: (JUL, 5),
1998: (JUN, 25),
1999: (JUN, 15),
2000: (JUN, 3),
2001: (MAY, 24),
2002: (MAY, 13),
2003: (MAY, 2),
2004: (APR, 20),
2005: (APR, 10),
2006: (MAR, 30),
2007: (MAR, 20),
2008: (MAR, 9),
2009: (FEB, 26),
2010: (FEB, 15),
2011: (FEB, 4),
2012: (JAN, 24),
2013: (JAN, 13),
2014: ((JAN, 2), (DEC, 23)),
2015: (DEC, 12),
2016: (NOV, 30),
2017: (NOV, 19),
2018: (NOV, 9),
2019: (OCT, 29),
2020: (OCT, 18),
2021: (OCT, 7),
2022: (SEP, 27),
2023: (SEP, 16),
2024: (SEP, 4),
2025: (AUG, 24),
2026: (AUG, 14),
2027: (AUG, 3),
2028: (JUL, 23),
2029: (JUL, 13),
2030: (JUL, 2),
2031: (JUN, 21),
2032: (JUN, 9),
2033: (MAY, 29),
2034: (MAY, 19),
2035: (MAY, 9),
2036: (APR, 27),
2037: (APR, 17),
2038: (APR, 6),
2039: (MAR, 26),
2040: (MAR, 14),
2041: (MAR, 4),
2042: (FEB, 21),
2043: (FEB, 11),
2044: (JAN, 31),
2045: (JAN, 19),
2046: ((JAN, 8), (DEC, 28)),
2047: (DEC, 18),
2048: (DEC, 7),
2049: (NOV, 26),
2050: (NOV, 15),
2051: (NOV, 5),
2052: (OCT, 24),
2053: (OCT, 13),
2054: (OCT, 2),
2055: (SEP, 22),
2056: (SEP, 11),
2057: (AUG, 31),
2058: (AUG, 20),
2059: (AUG, 9),
2060: (JUL, 28),
2061: (JUL, 18),
2062: (JUL, 8),
2063: (JUN, 27),
2064: (JUN, 16),
2065: (JUN, 5),
2066: (MAY, 25),
2067: (MAY, 14),
2068: (MAY, 3),
2069: (APR, 22),
2070: (APR, 12),
2071: (APR, 2),
2072: (MAR, 21),
2073: (MAR, 10),
2074: (FEB, 27),
2075: (FEB, 16),
2076: (FEB, 6),
2077: (JAN, 26),
}

RAMADAN_BEGINNING_DATES = {
1925: (MAR, 27),
1926: (MAR, 15),
Expand Down Expand Up @@ -3373,6 +3689,9 @@ def imam_mahdi_birthday_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def isra_and_miraj_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
return self._get_holiday(ISRA_AND_MIRAJ, year)

def maldives_embraced_islam_day_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
return self._get_holiday(MALDIVES_EMBRACED_ISLAM_DAY, year)

def mawlid_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
return self._get_holiday(MAWLID, year)

Expand All @@ -3382,6 +3701,9 @@ def nuzul_al_quran_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def prophet_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
return self._get_holiday(PROPHET_DEATH, year)

def quamee_dhuvas_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
return self._get_holiday(QUAMEE_DHUVAS, year)

def ramadan_beginning_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
return self._get_holiday(RAMADAN_BEGINNING, year)

Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
from .madagascar import Madagascar, MG, MDG
from .malawi import Malawi, MW, MWI
from .malaysia import Malaysia, MY, MYS
from .maldives import Maldives, MV, MDV
from .malta import Malta, MT, MLT
from .marshall_islands import MarshallIslands, MH, MHL, HolidaysMH
from .mexico import Mexico, MX, MEX
Expand Down
Loading

0 comments on commit 6fbabfc

Please sign in to comment.