Skip to content

Commit

Permalink
Merge branch 'beta' into laos_holidays
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius committed Sep 28, 2023
2 parents 4906f4c + 0d08573 commit b606be6
Show file tree
Hide file tree
Showing 11 changed files with 1,821 additions and 1,541 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Version 0.34

Released ???????? ??, ????

- Introduce holiday snapshots (#1478 by @arkid15r)
- Update ES snapshot (#1481 by @arkid15r)
- Update NYSE holidays: fix Juneteenth National Independence Day start year (#1484 by @KJhellico)
- Update Spain holidays (#1476 by @KJhellico)
- Update package configuration: migrate to pyproject.toml (#1466 by @arkid15r)

Version 0.33
============

Expand Down
151 changes: 145 additions & 6 deletions holidays/countries/belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from gettext import gettext as tr

from holidays.calendars.gregorian import GREGORIAN_CALENDAR
from holidays.calendars.gregorian import GREGORIAN_CALENDAR, JAN, MAR, APR, MAY, JUN, JUL, NOV, DEC
from holidays.calendars.julian import JULIAN_CALENDAR
from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase
Expand All @@ -24,30 +24,169 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays):
References:
- http://president.gov.by/en/holidays_en/
- http://www.belarus.by/en/about-belarus/national-holidays
- http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm
- http://president.gov.by/uploads/documents/2019/464uk.pdf
- https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B5%D0%BB%D0%BE%D1%80%D1%83%D1%81%D1%81%D0%B8%D0%B8 # noqa: E501
"""

country = "BY"
default_language = "be"
supported_languages = ("be", "en_US")
# Date format (see strftime() Format Codes)
substituted_date_format = tr("%d.%m.%Y")
# Day off (substituted from %s).
substituted_label = tr("Выходны (перанесены з %s)")
substituted_holidays = {
1998: (
(JAN, 10, JAN, 2),
(APR, 25, APR, 27),
),
1999: (
(JAN, 16, JAN, 8),
(APR, 17, APR, 19),
),
2000: (
(MAY, 13, MAY, 8),
(NOV, 11, NOV, 6),
),
2001: (
(JAN, 20, JAN, 2),
(MAR, 3, MAR, 9),
(APR, 21, APR, 23),
(APR, 28, APR, 30),
(JUL, 7, JUL, 2),
(DEC, 22, DEC, 24),
(DEC, 29, DEC, 31),
),
2002: (
(JAN, 5, JAN, 2),
(MAY, 18, MAY, 10),
(NOV, 16, NOV, 8),
),
2003: (
(JAN, 4, JAN, 6),
(MAY, 3, MAY, 5),
),
2004: (
(JAN, 10, JAN, 2),
(JAN, 17, JAN, 5),
(JAN, 31, JAN, 6),
(APR, 17, APR, 19),
),
2005: (MAR, 12, MAR, 7),
2006: (
(JAN, 21, JAN, 2),
(MAY, 6, MAY, 8),
(NOV, 4, NOV, 6),
),
2007: (
(2006, DEC, 30, JAN, 2),
(MAR, 17, MAR, 9),
(APR, 14, APR, 16),
(MAY, 5, APR, 30),
(JUL, 7, JUL, 2),
(DEC, 22, DEC, 24),
(DEC, 29, DEC, 31),
),
2008: (
(JAN, 12, JAN, 2),
(MAY, 3, MAY, 5),
(JUN, 28, JUL, 4),
(DEC, 20, DEC, 26),
),
2009: (
(JAN, 10, JAN, 2),
(APR, 25, APR, 27),
),
2010: (
(JAN, 23, JAN, 8),
(APR, 17, APR, 12),
(MAY, 15, MAY, 10),
),
2011: (
(MAR, 12, MAR, 7),
(MAY, 14, MAY, 2),
),
2012: (
(MAR, 11, MAR, 9),
(APR, 28, APR, 23),
(JUN, 30, JUL, 2),
(DEC, 22, DEC, 24),
(DEC, 29, DEC, 31),
),
2013: (
(JAN, 5, JAN, 2),
(MAY, 18, MAY, 10),
),
2014: (
(JAN, 4, JAN, 2),
(JAN, 11, JAN, 6),
(MAY, 3, APR, 30),
(JUL, 12, JUL, 4),
(DEC, 20, DEC, 26),
),
2015: (
(JAN, 10, JAN, 2),
(APR, 25, APR, 20),
),
2016: (
(JAN, 16, JAN, 8),
(MAR, 5, MAR, 7),
),
2017: (
(JAN, 21, JAN, 2),
(APR, 29, APR, 24),
(MAY, 6, MAY, 8),
(NOV, 4, NOV, 6),
),
2018: (
(JAN, 20, JAN, 2),
(MAR, 3, MAR, 9),
(APR, 14, APR, 16),
(APR, 28, APR, 30),
(JUL, 7, JUL, 2),
(DEC, 22, DEC, 24),
(DEC, 29, DEC, 31),
),
2019: (
(MAY, 4, MAY, 6),
(MAY, 11, MAY, 8),
(NOV, 16, NOV, 8),
),
2020: (
(JAN, 4, JAN, 6),
(APR, 4, APR, 27),
),
2021: (
(JAN, 16, JAN, 8),
(MAY, 15, MAY, 10),
),
2022: (
(MAR, 12, MAR, 7),
(MAY, 14, MAY, 2),
),
2023: (
(APR, 29, APR, 24),
(MAY, 13, MAY, 8),
(NOV, 11, NOV, 6),
),
}

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_CALENDAR)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate(self, year):
# The current set of holidays came into force in 1998.
# http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm
if year <= 1998:
# The current set of holidays actual from 1998.
if year <= 1997:
return None

super()._populate(year)

# New Year's Day.
self._add_new_years_day(tr("Новы год"))

# Jan 2nd is the national holiday (New Year) from 2020.
# http://president.gov.by/uploads/documents/2019/464uk.pdf
if year >= 2020:
self._add_new_years_day_two(tr("Новы год"))

Expand Down
5 changes: 3 additions & 2 deletions holidays/financial/ny_stock_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class NewYorkStockExchange(HolidayBase, ChristianHolidays, InternationalHolidays
- https://www.nyse.com/markets/hours-calendars
Historical data:
- s3.amazonaws.com/armstrongeconomics-wp/2013/07/NYSE-Closings.pdf
- https://web.archive.org/web/20211101162021/https://www.nyse.com/markets/hours-calendars
"""

market = "NYSE"
Expand Down Expand Up @@ -204,8 +205,8 @@ def _populate(self, year):
if 1916 <= year <= 1953:
self._add_observed_holiday("Flag Day", date(year, JUN, 14))

# JUNETEENTH: since 2021
if year >= 2021:
# JUNETEENTH: since 2022
if year >= 2022:
self._add_observed_holiday("Juneteenth National Independence Day", date(year, JUN, 19))

# INDEPENDENCE DAY (July 4) - history suggests closed every year
Expand Down
17 changes: 14 additions & 3 deletions holidays/locale/be/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.20\n"
"Project-Id-Version: Python Holidays 0.34\n"
"POT-Creation-Date: 2023-02-15 20:06-0800\n"
"PO-Revision-Date: 2023-02-16 08:45-0800\n"
"Last-Translator: Arkadii Yakovets <[email protected]>\n"
"PO-Revision-Date: 2023-09-27 18:49+0300\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Python Holidays localization team\n"
"Language: be\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || "
"n%100>14) ? 1 : 2);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"

#. Date format (see strftime() Format Codes)
msgid "%d.%m.%Y"
msgstr ""

#. Day off (substituted from %s).
#, c-format
msgid "Выходны (перанесены з %s)"
msgstr ""

#. New Year's Day.
msgid "Новы год"
msgstr ""
Expand Down
16 changes: 13 additions & 3 deletions holidays/locale/en_US/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.20\n"
"Project-Id-Version: Python Holidays 0.34\n"
"POT-Creation-Date: 2023-02-15 20:06-0800\n"
"PO-Revision-Date: 2023-02-14 17:52-0800\n"
"Last-Translator: Arkadii Yakovets <[email protected]>\n"
"PO-Revision-Date: 2023-09-27 18:50+0300\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Python Holidays localization team\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"

#. Date format (see strftime() Format Codes)
msgid "%d.%m.%Y"
msgstr "%m/%d/%Y"

#. Day off (substituted from %s).
#, c-format
msgid "Выходны (перанесены з %s)"
msgstr "Day off (substituted from %s)"

#. New Year's Day.
msgid "Новы год"
msgstr "New Year's Day"
Expand Down
Loading

0 comments on commit b606be6

Please sign in to comment.