vacanza / python-holidays

Generate and work with holidays in Python
https://pypi.org/project/holidays
MIT License
1.43k stars 456 forks source link

Dominican Republic - Data in Package not consistent with public holiday dates #1915

Closed npapadinu closed 1 week ago

npapadinu commented 4 weeks ago

Bug Report

Several holidays in the Dominican Republic in the package do not match the actual holiday dates.

Expected Behavior

Expected holidays for DO:

January 26: Duarte's Birthday May 1: Labour Day August 16: Restoration Day November 6: Constitution Day

Actual Behavior

The package appears to contain holiday dates that slightly differ from the actual holiday dates:

datetime.date(2024, 1, 29): 'Día de Duarte [Juan Pablo Duarte Day]', 
datetime.date(2024, 4, 29): 'Día del Trabajo [Labor Day]', 
datetime.date(2024, 8, 19): 'Día de la Restauración [Restoration Day]', 
datetime.date(2024, 11, 4): 'Día de la Constitución [Constitution Day]'

(In particular, this year Restoration Day falls on Friday, August 16th)

Steps to Reproduce the Problem

Run the following code:

current_year = datetime.now().year
do_holidays = holidays.country_holidays('DO', years = current_year)
do_holidays

Environment

Additional Context

Add any other context about the problem here.

KJhellico commented 3 weeks ago

@npapadinu , thank you for raise this issue. According to Law 139-97, some holidays (January 6, January 26, May 1, August 16 and November 6) are moved when they fall on:

npapadinu commented 3 weeks ago

Thank you for your reply, @KJhellico !

Ah, the legal stuff is hard to get through :) But the answer is clear!

I found this article mentioning holidays in 2024: https://presidencia.gob.do/noticias/ministerio-de-trabajo-informa-dias-feriados-correspondientes-al-ano-2024

It looks like Article 2 of that law mentions instances the holidays are not supposed to be moved:

Article 2.- The following holidays are excluded from the scope of application of this law:

January 1, New Year's Day.
January 21, Our Lady of La Altagracia Day.
February 27, National Independence Day.
August 16, when it coincides with the beginning of a constitutional period.
September 24, Las Mercedes Day.
December 25, Christmas Day.

So as you mentioned, some of the January and November holidays move, but August 16's holiday remains unmoved this year.

KJhellico commented 3 weeks ago

But what is "constitutional period" and how can we find out the beginning of it?

npapadinu commented 3 weeks ago

Yes, let me check with the contacts in DO to see if they have any context on that.

npapadinu commented 1 week ago

Apologies for the delay!

This is what the DO team told me: August 16th is a national holiday celebrated each year (Restoration Day). On this day, each year, they also celebrate the beginning of the new legislative period. So, Aug 16th will be a national holiday every year.

For the legislative/constitutional period, I was told that Aug 16th is the beginning of the presidential and legislative mandate (constitutional period for the new president term and new Congress&Senate)

So it sounds like Aug 16th is the only holiday that remains unaffected by the law mentioned earlier

KJhellico commented 1 week ago

I think I understand it now. "Constitutional period" here is 4 years of the elected president term. Our code already have processing of this rule, but only prior to 2008, with reference to "Judgment No. 14 of Feb 20, 2008 of the Supreme Court of Justice". Obviously, in practice, government do not consider this Judgment.