nager / Nager.Date

Worldwide holidays (REST API), NuGet or docker container :earth_americas:
https://date.nager.at
MIT License
1.06k stars 172 forks source link

Mexican Inauguration Day has a different date #584

Closed Javi-int closed 4 months ago

Javi-int commented 5 months ago

Affected country

Mexico

Affected public holiday

Inauguration Day

Source of the information

https://www.gob.mx/profedet/es/articulos/sabes-cuales-son-los-dias-de-descanso-obligatorio-para-este-2024

More information

Inauguration day is now every six year at October 1st. Instead of December 1st.

tinohager commented 4 months ago

I have checked the information and have now implemented a sustainable solution, would you please check it briefly, thank you very much

Javi-int commented 4 months ago

Thanks for the answer, I have checked the implementation, it seems to work for the past and the current year, but how will it work for future years? This is a recurring holiday (every six years), so it will happen again in 2030, 2036, and so on.

Also, you are right, that this holiday exists only since 1934.

Maybe something like this?

// Every 6 years on 1. December
if ((year - 2) % 6 == 0)
{
    if (year >= 1934 && year < 2024)
    {
        return new PublicHoliday(year, 12, 1, "Transmisión del Poder Ejecutivo Federal", "Inauguration Day", countryCode);
    }

    // Changed in 2024
    return new PublicHoliday(year, 10, 1, "Transmisión del Poder Ejecutivo Federal", "Inauguration Day", countryCode);
}

Thank you in advance

tinohager commented 4 months ago

I don't know why the date changed this year, but I have this list from chatgpt. It looks like the date isn't fixed, so I made it a little different

Roque González Garza (Interimspräsident): 10. Januar 1915 Francisco Lagos Cházaro (Interimspräsident): 10. Oktober 1915 Adolfo de la Huerta (Interimspräsident): 1. Juni 1920 Álvaro Obregón: 1. Dezember 1920 Plutarco Elías Calles: 1. Dezember 1924 Emilio Portes Gil: 1. Dezember 1928 Pascual Ortiz Rubio: 5. Februar 1930 Abelardo L. Rodríguez: 4. September 1932 Lázaro Cárdenas: 1. Dezember 1934 Manuel Ávila Camacho: 1. Dezember 1940 Miguel Alemán Valdés: 1. Dezember 1946 Adolfo Ruiz Cortines: 1. Dezember 1952 Adolfo López Mateos: 1. Dezember 1958 Gustavo Díaz Ordaz: 1. Dezember 1964 Luis Echeverría: 1. Dezember 1970 José López Portillo: 1. Dezember 1976 Miguel de la Madrid: 1. Dezember 1982 Carlos Salinas de Gortari: 1. Dezember 1988 Ernesto Zedillo: 1. Dezember 1994 Vicente Fox: 1. Dezember 2000 Felipe Calderón: 1. Dezember 2006 Enrique Peña Nieto: 1. Dezember 2012 Andrés Manuel López Obrador: 1. Dezember 2018

Javi-int commented 4 months ago

Article 83 of the Mexican Constitution states that

The President shall be inaugurated on December, 1st and shall hold his office during a term of six years

In 2014 a reform was made that changed the date:

The President shall be inaugurated on October, 1st and shall hold his office during a term of six years

Which came into effect this year.

Source (Spanish. Sorry, I cannot find it in English) Initiative (2013): https://www.senado.gob.mx/65/gaceta_del_senado/documento/43807 Article history: https://www.scjn.gob.mx/sites/default/files/cpeum/documento/2020-05/CPEUM-083.pdf

If you search "inauguration day Mexico" in Google, it tells you October 1st.

tinohager commented 4 months ago

I have updated the provider, now it will work for many years in the future