Skip to content
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

Add French holidays #15

Merged
merged 10 commits into from
Jan 19, 2024
Merged

Add French holidays #15

merged 10 commits into from
Jan 19, 2024

Conversation

levrailoup
Copy link
Contributor

No description provided.

@wblondel
Copy link

wblondel commented Jan 17, 2024

Hi @levrailoup
According to this page, these holidays also need to be included:

  • lundi de Pâques
  • Ascension
  • lundi de Pentecôte

Also, in the departments of Moselle, Bas-Rhin and Haut-Rhin, the list is slightly different: https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006902635

In Guadeloupe, Guyane, Martinique, Mayotte, La Réunion, Saint-Barthélemy and Saint-Martin, which are all part of France, there are additional holidays: https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000035902463

I am not sure if this package handles regional differences.

@levrailoup
Copy link
Contributor Author

Lundi de Pentecôte, Ascension and Lundi de Pâques are already included in the PR : As they are dependent upon Easter date, they can be found in France::variableHolidays().

As for the other dates you mention... I'm not quite sure what is expected from this package : should we have a specific class for each region ? Country codes don't include regions AFAIK, so it might prove difficult. "Vendredi Saint" is even town-specific...

In the meantime, the current PR includes all common holidays for mainland France.

src/Countries/France.php Outdated Show resolved Hide resolved
return 'fr';
}

/** @return array<string, CarbonImmutable> */
Copy link

Choose a reason for hiding this comment

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

this return type is wrong (but anyway, you should not need to specify it here. Inheriting it from the parent is better)

@Nielsvanpach
Copy link
Member

I've added documentation on how I think we should manage regions or states:
https://github.com/spatie/holidays?tab=readme-ov-file#contributing-a-new-country

@wblondel
Copy link

Lundi de Pentecôte, Ascension and Lundi de Pâques are already included in the PR : As they are dependent upon Easter date, they can be found in France::variableHolidays().

My bad. I must have forgotten to open my eyes 😅

@Nielsvanpach
Copy link
Member

Could you rebase this branch, I think it should allow the tests to run here

@Nielsvanpach
Copy link
Member

This PR looks good! I'll wait for the department based holidays before merging this.

I've added documentation on how I think we should manage regions, states or departments:
https://github.com/spatie/holidays?tab=readme-ov-file#contributing-a-new-country

@levrailoup
Copy link
Contributor Author

Added support for region-specific holidays. It uses ISO 3166-2 codes for now, but I am open to suggestions.

@Nielsvanpach
Copy link
Member

Thanks for your work on this one!

@Nielsvanpach Nielsvanpach merged commit 25c27c4 into spatie:main Jan 19, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants