8000 Add Sint Maarten holidays by psupra22 · Pull Request #2631 · vacanza/holidays · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Sint Maarten holidays #2631

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

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open

Add Sint Maarten holidays #2631

wants to merge 18 commits into from

Conversation

psupra22
Copy link

Proposed change

Adds support for Sint Maarten (SX) public holidays with full test coverage.
Resolves #2475

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

psupra22 added 17 commits June 13, 2025 14:02
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Signed-off-by: Platon Supranovich <psupra521@gmail.com>
Copy link
Contributor
coderabbitai bot commented Jun 14, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Sint Maarten holidays, including a comprehensive list of public and Christian holidays from 2010 onward.
    • Introduced Sint Maarten as a selectable country with aliases and country codes SX and SXM.
  • Documentation

    • Updated README to reflect support for Sint Maarten and its holiday coverage.
  • Tests

    • Added extensive tests to ensure correct holiday calculations and edge case handling for Sint Maarten.
  • Chores

    • Added a new contributor to the CONTRIBUTORS list.
    • Included translation template for Sint Maarten holidays.

Summary by CodeRabbit

  • New Features

    • Added support for Sint Maarten holidays, including fixed and movable public holidays, with English (US) language support.
    • Sint Maarten is now available as a supported country, increasing the total to 187.
  • Documentation

    • Updated documentation to include Sint Maarten in the list of supported countries.
  • Tests

    • Introduced comprehensive tests to ensure correct holiday calculations and observance rules for Sint Maarten.
  • Chores

    • Added contributor "Platon Supranovich" to the CONTRIBUTORS list.

Walkthrough

This update introduces a new holiday provider for Sint Maarten (SX), including its country code, holiday definitions, translations, and comprehensive tests. Documentation and registry files are updated to reflect Sint Maarten support, and a new contributor is added.

Changes

Files/Paths Change Summary
README.md Added Sint Maarten (SX) to supported countries table and updated country count.
holidays/countries/init.py, holidays/registry.py Imported SintMaarten provider and registered SX in the countries registry.
holidays/countries/sint_maarten.py Introduced SintMaarten holiday provider and its aliases (SX, SXM) with holiday logic.
holidays/locale/en_US/LC_MESSAGES/SX.po Added translation template for Sint Maarten holidays (en_US).
tests/countries/test_sint_maarten.py Added comprehensive unit tests for Sint Maarten holidays and edge cases.
CONTRIBUTORS Added "Platon Supranovich" to the contributors list.

Assessment against linked issues

Objective Addressed Explanation
Add SX Sint Maarten holidays (#2475)

Assessment against linked issues: Out-of-scope changes

Code Change (file_path) Explanation
Addition of "Platon Supranovich" to CONTRIBUTORS This change is unrelated to adding Sint Maarten holidays but is harmless.

Suggested labels

l10n, test

Suggested reviewers

  • KJhellico
  • arkid15r

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3df7139 and 48391ae.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/registry.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/sint_maarten.py (3)
  • SintMaarten (21-94)
  • SX (97-98)
  • SXM (101-102)
🔇 Additional comments (3)
holidays/countries/__init__.py (1)

172-172: Import Sint Maarten provider. The Sint Maarten holiday provider and its SX/SXM aliases are imported in the correct alphabetical spot, aligning with existing country modules.

holidays/registry.py (1)

175-175: Register Sint Maarten in registry. The "sint_maarten" key is added with the right class name and aliases, and it's placed in proper alphabetical order among other countries.

README.md 10000 (1)

1214-1220: Add Sint Maarten documentation. The new table row is correctly formatted, alphabetized between Singapore and Slovakia, and displays the proper code and supported language.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch dev
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🔭 Outside diff range comments (1)
holidays/locale/en_US/LC_MESSAGES/SX.po (1)

21-75: ⚠️ Potential issue

Empty translations in msgstr fields

All msgstr entries are empty, which will cause blank labels for holidays in the default en_US locale. Please populate each msgstr with the corresponding msgid (e.g., msgstr "New Year's Day") or remove the file so the code falls back to the original English strings.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a934403 and 3df7139.

📒 Files selected for processing (7)
  • CONTRIBUTORS (1 hunks)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/sint_maarten.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/SX.po (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_sint_maarten.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_sint_maarten.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
🧬 Code Graph Analysis (2)
holidays/countries/__init__.py (1)
holidays/countries/sint_maarten.py (3)
  • SintMaarten (21-94)
  • SX (97-98)
  • SXM (101-102)
tests/countries/test_sint_maarten.py (2)
tests/common.py (7)
  • CommonCountryTests (356-374)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidays (228-230)
  • assertNoHolidayName (273-275)
  • assertHolidayName (195-199)
  • assertNoHoliday (244-246)
holidays/countries/sint_maarten.py (3)
  • SintMaarten (21-94)
  • SX (97-98)
  • SXM (101-102)
🪛 Pylint (3.3.7)
holidays/countries/sint_maarten.py

[convention] 26-26: Line too long (116/100)

(C0301)


[convention] 27-27: Line too long (113/100)

(C0301)


[convention] 28-28: Line too long (120/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 97-97: Missing class docstring

(C0115)


[convention] 101-101: Missing class docstring

(C0115)

tests/countries/test_sint_maarten.py

[convention] 1-1: Missing module docstring

(C0114)


[convention] 20-20: Missing class docstring

(C0115)


[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestSintMaarten.setUpClass' method

(W0221)


[convention] 25-25: Missing function or method docstring

(C0116)


[convention] 28-28: Missing function or method docstring

(C0116)


[convention] 31-31: Missing function or method docstring

(C0116)


[convention] 51-51: Missing function or method docstring

(C0116)


[convention] 61-61: Missing function or method docstring

(C0116)


[warning] 62-62: Redefining name 'TestSintMaarten' from outer scope (line 20)

(W0621)


[convention] 62-62: Missing class docstring

(C0115)


[convention] 83-83: Missing function or method docstring

(C0116)


[convention] 88-88: Missing function or method docstring

(C0116)


[convention] 105-105: Missing function or method docstring

(C0116)


[convention] 110-110: Missing function or method docstring

(C0116)


[convention] 115-115: Missing function or method docstring

(C0116)


[convention] 135-135: Missing function or method docstring

(C0116)


[convention] 142-142: Missing function or method docstring

(C0116)


[convention] 147-147: Missing function or method docstring

(C0116)

🔇 Additional comments (6)
CONTRIBUTORS (1)

121-121: Contributor Added in Correct Order

The new entry for Platon Supranovich is correctly placed between Piotr Staniów and Prateekshit Jaiswal, preserving the alphabetical order.

holidays/registry.py (1)

174-174: Sint Maarten Registered in COUNTRY Dictionary

The entry "sint_maarten": ("SintMaarten", "SX", "SXM") has been added consistently with existing country definitions.

README.md (2)

108-108: Supported Country Count Updated

The count was correctly incremented from 186 to 187 to reflect the addition of Sint Maarten.


1207-1212: Sint Maarten Row Added to Country Table

The <tr> entry for Sint Maarten with code SX, no subdivisions, default en_US language, and no extra categories is formatted consistently with other rows.

holidays/countries/__init__.py (1)

171-171: Import for SintMaarten Properly Inserted and Sorted

The line from holidays.countries.sint_maarten import SintMaarten, SX, SXM is correctly added after Singapore and before Slovakia, preserving the import order.

tests/countries/test_sint_maarten.py (1)

23-23: 🧹 Nitpick (assertive)

setUpClass signature mismatch flagged by pylint is expected – suppress it locally.

Overriding setUpClass(cls, entity_cls, years=...) is the established pattern inside CommonCountryTests. Consider adding a # pylint: disable=arguments-differ comment to silence future noise.

⛔ Skipped due to learnings
Learnt from: KJhellico
PR: vacanza/holidays#2609
File: tests/countries/test_nauru.py:20-24
Timestamp: 2025-06-13T15:15:25.128Z
Learning: In the vacanza/holidays test suite, overriding `setUpClass` is intentionally done with the single `cls` parameter (no *args/**kwargs), so signature-mismatch lint warnings are ignored project-wide.

Copy link

@KJhellico KJhellico changed the title Add SX Sint Maarten holidays Add Sint Maarten holidays Jun 14, 2025
Copy link
Collaborator
@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions for the beginning.

Comment on lines +32 to +33
default_language = "en_US"
supported_languages = ("en_US",)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't have plans to add other languages (such as Dutch), it is reasonable to delete everything related to localization.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we got the original law in Dutch language, so perhaps we should consider adding that as well 👀

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was told that you should only add languages that are native to you, so I only did English.

country = "SX"
default_language = "en_US"
supported_languages = ("en_US",)
start_year = 2010
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
start_year = 2010
# Sint Maarten became a constituent country on October 10, 2010.
start_year = 2011

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So start year should be the year after it became a country?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need first full year.

super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# New Year's Day
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# New Year's Day
# New Year's Day.

And for all comments below.

Comment on lines +54 to +59
# King's Day (April 27 or April 26 if 27 is a Sunday)
if self._year >= 2014:
if date(self._year, APR, 27).weekday() == 6:
self._add_holiday(tr("King's Day"), date(self._year, APR, 26))
else:
self._add_holiday(tr("King's Day"), date(self._year, APR, 27))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see an example of this holiday implementation in Curaçao.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So like this?

King's Day.

name = ("King's Day")
dt = date(self._year, APR, 27 if self._year >= 2014 else 30)
if self._is_sunday(dt):
dt = _timedelta(dt, -1 if self._year >= 1980 else +1)
self._add_holiday(name, dt)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in your case, you don't need to check for 1980.

Comment on lines +61 to +62
# Note: Carnival Day date may vary; verify annually
self._add_holiday(tr("Carnival Day"), date(self._year, APR, 30))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

This is how holidays with a fixed date are implemented. (I haven't checked yet whether it really has a fixed date).

Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to 2014-2026 data (see my wayback machine links above), if it falls on Saturday then it got moved back to Friday, but if it falls on Sunday, this is usually moved to Tuesday, May 2nd instead not to overlap with Labour Day 👀

Suggested change
# Note: Carnival Day date may vary; verify annually
self._add_holiday(tr("Carnival Day"), date(self._year, APR, 30))
# Carnival Day.
self._add_holiday_apr_30(tr("Carnival Day"))
# Note: Carnival Day date may vary; verify annually
self._add_holiday(tr("Carnival Day"), date(self._year, APR, 30))
self._add_observed(
# Carnival Day.
self._add_holiday_apr_30(tr("Carnivalsdag"), rule=SAT_TO_PREV_FRI + SUN_TO_NEXT_TUE
)

Copy link
Collaborator
@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start so far, though for test case I would recommend the recently merged test_nauru.py as a base 👍

<td>Sint Maarten</td>
<td>SX</td>
<td></td>
<td><strong>en_US</strong></td>
Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that the original law is in Dutch and the annual list is in English (mostly to preserve the original "Labour Day" spelling that's not in en_US)👀

Suggested change
<td><strong>en_US</strong></td>
<td>en_SX, en_US, <strong>nl</strong></td>

* <https://web.archive.org/web/20250606191248/https://en.wikipedia.org/wiki/Sint_Maarten>
* <https://web.archive.org/web/20250529071040/https://en.wikipedia.org/wiki/Public_holidays_in_Sint_Maarten>
* <https://web.archive.org/web/20250425015159/https://www.qppstudio.net/public-holidays/sint_maarten.htm>
* <https://web.archive.org/web/20250212071023/https://www.sintmaartengov.org/Pages/Public-Holiday-Schedule.aspx>
Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional sources here 👍

Suggested change
* <https://web.archive.org/web/20250212071023/https://www.sintmaartengov.org/Pages/Public-Holiday-Schedule.aspx>
* [AB 2012 no. 19](https://web.archive.org/web/20250615040244/https://www.sintmaartengov.org/Documents/Official%20Publications/AB%2019%20Lvo%20Dag%20van%20Bevrijding.pdf)
* [AB 2015 no. 24](https://web.archive.org/web/20250615035932/https://www.sintmaartengov.org/Documents/Official%20Publications/AB%2024%20Landsverordening%20Constitution%20Day.pdf)
* [2014-2023](https://web.archive.org/web/20230307083630/https://www.sintmaartengov.org/government/VSA/labour/Pages/Public-Holiday-Schedule.aspx)
* [2024-Present](https://web.archive.org/web/20250212071023/https://www.sintmaartengov.org/Pages/Public-Holiday-Schedule.aspx)

Comment on lines +32 to +33
default_language = "en_US"
supported_languages = ("en_US",)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we got the original law in Dutch language, so perhaps we should consider adding that as well 👀

Comment on lines +61 to +62
# Note: Carnival Day date may vary; verify annually
self._add_holiday(tr("Carnival Day"), date(self._year, APR, 30))
Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to 2014-2026 data (see my wayback machine links above), if it falls on Saturday then it got moved back to Friday, but if it falls on Sunday, this is usually moved to Tuesday, May 2nd instead not to overlap with Labour Day 👀

Suggested change
# Note: Carnival Day date may vary; verify annually
self._add_holiday(tr("Carnival Day"), date(self._year, APR, 30))
self._add_observed(
# Carnival Day.
self._add_holiday_apr_30(tr("Carnivalsdag"), rule=SAT_TO_PREV_FRI + SUN_TO_NEXT_TUE
)

Comment on lines +77 to +82
# Constitution Day
if self._year >= 2010:
constitution_day = date(self._year, OCT, 1) + timedelta(
days=(7 - date(self._year, OCT, 1).weekday()) % 7 + 7
)
self._add_holiday(tr("Constitution Day"), constitution_day)
Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.sintmaartengov.org/Documents/Official%20Publications/AB%2024%20Landsverordening%20Constitution%20Day.pdf

Suggested change
# Constitution Day
if self._year >= 2010:
constitution_day = date(self._year, OCT, 1) + timedelta(
days=(7 - date(self._year, OCT, 1).weekday()) % 7 + 7
)
self._add_holiday(tr("Constitution Day"), constitution_day)
# Established on September 28th, 2015.
if self._year >= 2015:
# Constitution Day.
self._add_holiday_2nd_mon_of_oct(tr("Dag van de Constitutie"))

This replaces "Koninkrijksdag" (Kingdom Day) on DEC, 15 in years prior (please implement that as well).

"Project-Id-Version: Holidays 0.75\n"
"POT-Creation-Date: 2025-06-14 14:20-0400\n"
"PO-Revision-Date: 2025-06-14 14:20-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your contact info goes here 👍

Comment on lines +1 to +4
# SOME DESCRIPTIVE TITLE
# This file is distributed under the same license as the Holidays package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025. B41A
#, fuzzy
Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the default language, you can leave xx_XX localization suffix out (just #Sint Maarten holidays.)👍

Suggested change
# SOME DESCRIPTIVE TITLE
# This file is distributed under the same license as the Holidays package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
#, fuzzy
# 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)
#
# Sint Maarten holidays en_US localization.
#

Comment on lines +73 to +75
# Emancipation Day
if self._year >= 2010:
self._add_holiday(tr("Emancipation Day"), date(self._year, JUL, 1))
Copy link
Collaborator
@PPsyrius PPsyrius Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.sintmaartengov.org/Documents/Official%20Publications/AB%2019%20Lvo%20Dag%20van%20Bevrijding.pdf

Suggested change
# Emancipation Day
if self._year >= 2010:
self._add_holiday(tr("Emancipation Day"), date(self._year, JUL, 1))
# Established on June 13th, 2012.
if self._year >= 2012:
# Emancipation Day.
self._add_observed(self._add_holiday_jul_1(tr("Dag van de Bevrijding")))

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and self._add_observed( ... ) goes for any holidays that isn't always observed on weekdays

Suggested change
super().__init__(*args, **kwargs)
kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON)
super().__init__(*args, **kwargs)

Comment on lines +51 to +60
def test_pre_2010_edge_cases(self):
holidays = SintMaarten(years=2009)
self.assertNotIn(date(2009, 7, 1), holidays) # No Emancipation Day
self.assertNotIn(date(2009, 10, 12), holidays) # No Constitution Day
self.assertNotIn(date(2009, 11, 1), holidays) # No All Saints' Day
self.assertNotIn(date(2009, 11, 11), holidays) # No Sint Maarten Day
self.assertNotIn(date(2009, 4, 27), holidays) # No King's Day
self.assertNotIn(date(2009, 4, 26), holidays) # No King's Day (Sunday case)
self.assertNotIn(date(2009, 4, 30), holidays) # No Carnival Day

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already handled in test_no_holidays

Suggested change
def test_pre_2010_edge_cases(self):
holidays = SintMaarten(years=2009)
self.assertNotIn(date(2009, 7, 1), holidays) # No Emancipation Day
self.assertNotIn(date(2009, 10, 12), holidays) # No Constitution Day
self.assertNotIn(date(2009, 11, 1), holidays) # No All Saints' Day
self.assertNotIn(date(2009, 11, 11), holidays) # No Sint Maarten Day
self.assertNotIn(date(2009, 4, 27), holidays) # No King's Day
self.assertNotIn(date(2009, 4, 26), holidays) # No King's Day (Sunday case)
self.assertNotIn(date(2009, 4, 30), holidays) # No Carnival Day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SX Sint Maarten holidays
4 participants
0