python-holidays icon indicating copy to clipboard operation
python-holidays copied to clipboard

Today is not holiday in region CT, Spain.

Open mrbluebrett opened this issue 2 years ago • 4 comments

Hi, the library is returning holiday today 12th of September for Catalonia (CT), Spain. That's wrong. Today is working day. I think the issue is the holiday from yesterday (Sep. 11th) is traslated to today because yesterday was Sunday as I have seen in the code. But here we do not move the holyday to the next day if it's sunday... Usually they assign another local holiday and that's it... Can you exclude the +1 day rule when it's sunday?

mrbluebrett avatar Sep 12 '22 07:09 mrbluebrett

Hi @mrbluebrett,

I googled a bit and it seems that there are only 2 holidays that can be moved to Monday (and that is decided by each Autonomous Community) - Christmas Day and Labor Day. Everything else is usually celebrated on the day of the holiday. Is this logic correct? Thanks!

kasya avatar Sep 29 '22 18:09 kasya

Not exactly. All national holidays that happen in sunday can be moved to another day, but each autonomous community decides the new day. Some of the choose the next Monday, but others a completely different day. And also this can change every year so a community that choses to move one holiday to monday one year, the next year can choose to move to a completely different day. I have also seen in the code that you have put JUN 6 as a holiday in CT, but that was only true this year. When this holiday happens is 7 weeks (or 49 days) after easter monday. And also this only happens if 1 of the 4 autonomous holidays for catalonia (easter monday, JUN 24, SEP 11 and DEC 26) happen in sunday. Feel free to ask if you need more clarification.

mrbluebrett avatar Sep 29 '22 20:09 mrbluebrett

If there's no definitive logic in how sunday holidays are moved it might be hard to program it.

When this holiday happens is 7 weeks (or 49 days) after easter monday. And also this only happens if 1 of the 4 autonomous holidays for catalonia (easter monday, JUN 24, SEP 11 and DEC 26) happen in sunday.

And about this one... So, as I understand it at this moment: if any of those 4 holidays fall on Sunday, you kind of have one "unused" holiday and in this case you have this Pentecost Monday (Jun 6 this year) somewhere in May-June. But if none of those 4 were on Sunday - you don't get a day off, is that correct?

kasya avatar Sep 29 '22 21:09 kasya

When this holiday happens is 7 weeks (or 49 days) after easter monday. And also this only happens if 1 of the 4 autonomous holidays for catalonia (easter monday, JUN 24, SEP 11 and DEC 26) happen in sunday.

And about this one... So, as I understand it at this moment: if any of those 4 holidays fall on Sunday, you kind of have one "unused" holiday and in this case you have this Pentecost Monday (Jun 6 this year) somewhere in May-June. But if none of those 4 were on Sunday - you don't get a day off, is that correct?

Yes, that’s correct for Catalonia. It’s the first substitute holiday for the other four (in fact 3, because easter monday can never be in sunday).

mrbluebrett avatar Sep 29 '22 21:09 mrbluebrett

Apparently it's no longer an issue after multiple Spain holidays fixes and refactorings.

>>> "2022-09-12" in holidays.ES(years=2022, subdiv="CT")
False

Closing this.

arkid15r avatar Nov 15 '23 19:11 arkid15r