Repository: vacanza/python-holidays

Issue:
Fix Carnival date of the "Portugal" calendar
Currently, the package incorrectly indicates that the Carnival "holiday" is on the Monday before the actual date, which in 2024 is 2024/02/13 (YYYY/MM/DD).
It's clear from the method name `_add_carnival_monday()`.

This seems to be the problematic area.
<img width="504" alt="Captura de ecrã 2024-02-16, às 17 56 57" src="https://github.com/vacanza/python-holidays/assets/16542680/bf1ac118-c246-43f3-ae53-535af6742cf6">

I'm more than happy to open a PR.

Thank you for the excellent work 🚀!


Discussion:
Hi @DgRosa!

It seems `self._add_carnival_monday(tr("Carnaval"))` needs to be changed to `self._add_carnival_tuesday(tr("Carnaval"))`, right?

>I'm more than happy to open a PR.

We'd be happy to have another Python Holidays contributor!


Perfect, I'll do that then.
@arkid15r I don't have much experience contributing to open source projects, so I have some questions on how to proceed with the PR.
I see that the current PRs are from forks, is this what I should do or is it possible to create a branch and open a PR directly in this repository?
Thank you for your time.
Yes, we work with pull request based contributions. You won't be able to create a new branch due to lack of write permissions. You can read more about the PR based collaboration [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests).

Resolving patch:
diff --git a/holidays/countries/portugal.py b/holidays/countries/portugal.py
--- a/holidays/countries/portugal.py
+++ b/holidays/countries/portugal.py
@@ -145,7 +145,7 @@ def _populate_optional_holidays(self):
         # - get Holidays that occur on Thursday and add Friday (+1 day)
 
         # Carnival.
-        self._add_carnival_monday(tr("Carnaval"))
+        self._add_carnival_tuesday(tr("Carnaval"))
 
         # St. Anthony's Day.
         self._add_holiday_jun_13(tr("Dia de Santo António"))


Test patch:
diff --git a/tests/countries/test_portugal.py b/tests/countries/test_portugal.py
--- a/tests/countries/test_portugal.py
+++ b/tests/countries/test_portugal.py
@@ -153,17 +153,17 @@ def test_optional_holidays(self):
         holidays = Portugal(categories=OPTIONAL, years=range(2017, 2020))
         self.assertHoliday(
             holidays,
-            "2017-02-27",
+            "2017-02-28",
             "2017-06-13",
             "2017-12-24",
             "2017-12-26",
             "2017-12-31",
-            "2018-02-12",
+            "2018-02-13",
             "2018-06-13",
             "2018-12-24",
             "2018-12-26",
             "2018-12-31",
-            "2019-03-04",
+            "2019-03-05",
             "2019-06-13",
             "2019-12-24",
             "2019-12-26",
@@ -243,7 +243,7 @@ def test_portugal_day(self):
     def test_l10n_default(self):
         self.assertLocalizedHolidays(
             ("2018-01-01", "Ano Novo"),
-            ("2018-02-12", "Carnaval"),
+            ("2018-02-13", "Carnaval"),
             ("2018-03-30", "Sexta-feira Santa"),
             ("2018-04-01", "Páscoa"),
             ("2018-04-25", "Dia da Liberdade"),
@@ -266,7 +266,7 @@ def test_l10n_en_us(self):
         self.assertLocalizedHolidays(
             "en_US",
             ("2018-01-01", "New Year's Day"),
-            ("2018-02-12", "Carnival"),
+            ("2018-02-13", "Carnival"),
             ("2018-03-30", "Good Friday"),
             ("2018-04-01", "Easter Sunday"),
             ("2018-04-25", "Freedom Day"),
@@ -289,7 +289,7 @@ def test_l10n_uk(self):
         self.assertLocalizedHolidays(
             "uk",
             ("2022-01-01", "Новий рік"),
-            ("2022-02-28", "Карнавал"),
+            ("2022-03-01", "Карнавал"),
             ("2022-04-15", "Страсна пʼятниця"),
             ("2022-04-17", "Великдень"),
             ("2022-04-25", "День Свободи"),