-
-
Notifications
You must be signed in to change notification settings - Fork 560
Add Seychelles holidays #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Seychelles holidays #1728
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| # python-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: dr-prodigy <[email protected]> (c) 2017-2023 | ||
| # ryanss <[email protected]> (c) 2014-2017 | ||
| # Website: https://github.com/dr-prodigy/python-holidays | ||
| # License: MIT (see LICENSE file) | ||
|
|
||
| from gettext import gettext as tr | ||
|
|
||
| from holidays.calendars.gregorian import JAN, MAR, MAY, SEP, OCT, DEC | ||
| from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays | ||
| from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON | ||
|
|
||
|
|
||
| class Seychelles(ObservedHolidayBase, ChristianHolidays, InternationalHolidays): | ||
| """ | ||
| https://www.psb.gov.sc/public-holidays | ||
| https://www.cbs.sc/PublicHolidays.html | ||
|
|
||
| [Act 19 of 1976, 1994 Amendment] | ||
| Oldest Seychelles Holidays Law available online in full. | ||
| https://seylii.org/akn/sc/act/1976/19/eng@2012-06-30 | ||
| [Act 11 of 2014] | ||
| Holidays names changed. | ||
| https://seylii.org/akn/sc/act/2014/11/eng@2014-08-04 | ||
| [Act 3 of 2017] | ||
| Added Easter Monday, repealing Liberation Day. | ||
| https://seylii.org/akn/sc/act/2017/3/eng@2017-04-12 | ||
|
|
||
| Where any public holiday, except Sunday, falls on a Sunday the next following day, | ||
| not being itself a public holiday, shall be a public holiday. | ||
| """ | ||
|
|
||
| country = "SC" | ||
| default_language = "en_SC" | ||
| # %s (observed). | ||
| observed_label = tr("%s (observed)") | ||
| supported_languages = ("en_SC", "en_US") | ||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| ChristianHolidays.__init__(self) | ||
| InternationalHolidays.__init__(self) | ||
| StaticHolidays.__init__(self, SeychellesStaticHolidays) | ||
| kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON) | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
| def _populate_public_holidays(self): | ||
| # Earliest source is the 1994 amendment of Seychelles Public Holidays Act. | ||
| if self._year <= 1993: | ||
| return None | ||
|
|
||
| # New Year's Day. | ||
| self._add_new_years_day(tr("New Year's Day")) | ||
|
|
||
| # New Year Holiday. | ||
| self._add_observed(self._add_new_years_day_two(tr("New Year Holiday"))) | ||
|
|
||
| # Good Friday. | ||
| self._add_good_friday(tr("Good Friday")) | ||
|
|
||
| # Easter Saturday. | ||
| self._add_holy_saturday(tr("Easter Saturday")) | ||
|
|
||
| if self._year >= 2017: | ||
| # Easter Monday. | ||
| self._add_easter_monday(tr("Easter Monday")) | ||
|
|
||
| # Labour Day. | ||
arkid15r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| self._add_observed(self._add_labor_day(tr("Labour Day"))) | ||
|
|
||
| # The Fete Dieu. | ||
| self._add_corpus_christi_day(tr("The Fete Dieu")) | ||
|
|
||
| if self._year <= 2016: | ||
| # Liberation Day. | ||
| self._add_observed(self._add_holiday_jun_5(tr("Liberation Day"))) | ||
|
|
||
| self._add_observed( | ||
| self._add_holiday_jun_18( | ||
| # National Day. | ||
| tr("National Day") | ||
| if self._year <= 2014 | ||
| # Constitution Day. | ||
| else tr("Constitution Day") | ||
| ) | ||
| ) | ||
|
|
||
| self._add_observed( | ||
| self._add_holiday_jun_29( | ||
| # Independence Day. | ||
| tr("Independence Day") | ||
| if self._year <= 2014 | ||
| # Independence (National) Day. | ||
| else tr("Independence (National) Day") | ||
| ) | ||
| ) | ||
|
|
||
| # Assumption Day. | ||
| self._add_observed(self._add_assumption_of_mary_day(tr("Assumption Day"))) | ||
|
|
||
| # All Saints Day. | ||
| self._add_observed(self._add_all_saints_day(tr("All Saints Day"))) | ||
|
|
||
| self._add_observed( | ||
| # The Feast of the Immaculate Conception. | ||
| self._add_immaculate_conception_day(tr("The Feast of the Immaculate Conception")) | ||
| ) | ||
|
|
||
| # Christmas Day. | ||
| self._add_observed(self._add_christmas_day(tr("Christmas Day"))) | ||
|
|
||
|
|
||
| class SC(Seychelles): | ||
| pass | ||
|
|
||
|
|
||
| class SYC(Seychelles): | ||
| pass | ||
|
|
||
|
|
||
| class SeychellesStaticHolidays: | ||
| """ | ||
| Sources: | ||
| - https://seylii.org/akn/sc/act/si/2015/58/eng@2015-12-01 | ||
| - https://seylii.org/akn/sc/act/si/2015/59/eng@2015-12-11 | ||
| - https://seylii.org/akn/sc/act/si/2016/58/eng@2016-09-06 | ||
| - https://seylii.org/akn/sc/act/si/2019/10/eng@2019-03-05 | ||
| - https://seylii.org/akn/sc/act/si/2019/61/eng@2019-10-18 | ||
| - https://seylii.org/akn/sc/act/si/2020/134/eng@2020-09-17 | ||
| - https://seylii.org/akn/sc/act/si/2020/154/eng@2020-10-26 | ||
| - https://www.statehouse.gov.sc/news/1765/public-holiday-october-1 | ||
| - https://www.egov.sc/PressRoom/DisplayPressRelease.aspx?PRLID=196 | ||
| - https://www.nation.sc/archive/216478/saturday-may-12-2007-public-holiday | ||
|
|
||
| All Election Dates usually proceed from the Outer Islands first, then the Inner Islands, and | ||
| the main capital, Mahé, on the last day. The current implementation only uses the last day, | ||
| as officially decreed in 2007, 2011, 2015, and 2020. | ||
| """ | ||
|
|
||
| # Bridge Public Holiday. | ||
| bridge_public_holiday = tr("Bridge Public Holiday") | ||
|
|
||
| # Presidential Election Day. | ||
| presidential_election_day = tr("Presidential Election Day") | ||
|
|
||
| # Parliamentary Election Day. | ||
| parliamentary_election_day = tr("Parliamentary Election Day") | ||
|
|
||
| # General Election Day. | ||
| general_election_day = tr("General Election Day") | ||
|
|
||
| special_public_holidays = { | ||
| 2007: (MAY, 12, presidential_election_day), | ||
| 2011: ( | ||
| (MAY, 21, presidential_election_day), | ||
| (OCT, 1, parliamentary_election_day), | ||
| ), | ||
| 2015: ( | ||
| (DEC, 5, presidential_election_day), | ||
| (DEC, 18, presidential_election_day), | ||
| ), | ||
| 2016: (SEP, 10, parliamentary_election_day), | ||
| # Funeral of the Former President France Albert René. | ||
| 2019: (MAR, 7, tr("Funeral of the Former President France Albert René")), | ||
| 2020: ( | ||
| (JAN, 3, bridge_public_holiday), | ||
| (OCT, 24, general_election_day), | ||
| (OCT, 26, bridge_public_holiday), | ||
| ), | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Seychelles holidays. | ||
| # Authors: PPsyrius <[email protected]>, (c) 2024. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Python Holidays 0.45\n" | ||
| "POT-Creation-Date: 2024-03-01 11:00+0700\n" | ||
| "PO-Revision-Date: 2024-03-05 16:34+0700\n" | ||
| "Last-Translator: PPsyrius <[email protected]>\n" | ||
| "Language-Team: Python Holidays localization team\n" | ||
| "Language: en_SC\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.4.2\n" | ||
|
|
||
| #. %s (observed). | ||
| #, c-format | ||
| msgid "%s (observed)" | ||
| msgstr "" | ||
|
|
||
| #. New Year's Day. | ||
| msgid "New Year's Day" | ||
| msgstr "" | ||
|
|
||
| #. New Year Holiday. | ||
| msgid "New Year Holiday" | ||
| msgstr "" | ||
|
|
||
| #. Good Friday. | ||
| msgid "Good Friday" | ||
| msgstr "" | ||
|
|
||
| #. Easter Saturday. | ||
| msgid "Easter Saturday" | ||
| msgstr "" | ||
|
|
||
| #. Easter Monday. | ||
| msgid "Easter Monday" | ||
| msgstr "" | ||
|
|
||
| #. Labour Day. | ||
| msgid "Labour Day" | ||
| msgstr "" | ||
|
|
||
| #. The Fete Dieu. | ||
| msgid "The Fete Dieu" | ||
| msgstr "" | ||
|
|
||
| #. Liberation Day. | ||
| msgid "Liberation Day" | ||
| msgstr "" | ||
|
|
||
| #. National Day. | ||
| msgid "National Day" | ||
| msgstr "" | ||
|
|
||
| #. Constitution Day. | ||
| msgid "Constitution Day" | ||
| msgstr "" | ||
|
|
||
| #. Independence Day. | ||
| msgid "Independence Day" | ||
| msgstr "" | ||
|
|
||
| #. Independence (National) Day. | ||
| msgid "Independence (National) Day" | ||
| msgstr "" | ||
|
|
||
| #. Assumption Day. | ||
| msgid "Assumption Day" | ||
| msgstr "" | ||
|
|
||
| #. All Saints Day. | ||
| msgid "All Saints Day" | ||
| msgstr "" | ||
|
|
||
| #. The Feast of the Immaculate Conception. | ||
| msgid "The Feast of the Immaculate Conception" | ||
| msgstr "" | ||
|
|
||
| #. Christmas Day. | ||
| msgid "Christmas Day" | ||
| msgstr "" | ||
|
|
||
| #. Bridge Public Holiday. | ||
| msgid "Bridge Public Holiday" | ||
| msgstr "" | ||
|
|
||
| #. Presidential Election Day. | ||
| msgid "Presidential Election Day" | ||
| msgstr "" | ||
|
|
||
| #. Parliamentary Election Day. | ||
| msgid "Parliamentary Election Day" | ||
| msgstr "" | ||
|
|
||
| #. General Election Day. | ||
| msgid "General Election Day" | ||
| msgstr "" | ||
|
|
||
| #. Funeral of the Former President France Albert René. | ||
| msgid "Funeral of the Former President France Albert René" | ||
| msgstr "" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.