azuyalabs / yasumi

The easy PHP Library for calculating holidays
https://www.yasumi.dev
Other
1.04k stars 152 forks source link

Adding Swiss provider #56

Closed qligier closed 7 years ago

qligier commented 7 years ago

This PR adds common holidays of Switzerland (including the sub-regions Aargau, Appenzell Ausserrhoden, Appenzell Innerrhoden, Basel Landschaft, Basel Stadt, Bern, Fribourg, Geneva, Glarus, Grisons, Jura, Lucerne, Neuchatel, Nidwalden, Obwalden, Schaffhausen, Schwyz, Solothurn, St. Gallen, Thurgau, Ticino, Uri, Valais, Vaud, Zug and Zurich).

Except for the Swiss national day, holidays are to be chosen by cantons, not by the government so a provider for each canton is provided.

The PR includes the providers, unit tests and translation of common holidays.

stelgenhof commented 7 years ago

@qligier Thank you so much for this! Must have been quite a job. Let me have a look and merge your PR if all looks fine 👍

qligier commented 7 years ago

It has been quite hard because of the fragmentation of holidays visible in this doc (in blue, holidays that only exist in sub-sub-regions).

I've implemented all holidays except the Swiss national day as other. They could also be set as national or we could create a regional type.

stelgenhof commented 7 years ago

After briefly checking your PR, I realize that the type 'NATIONAL' is not quite appropriate. My intention was this one to reflect the official holidays irrespective of the region/subregion. I think I am going to change the naming for that so it better reflects this situation.

qligier commented 7 years ago

Renaming national to official could be a good thing (even if bank and seasonal holidays also are official). Differentiate between national and regional holidays is maybe not that important. That could also be useful for Australia, France, Germany and Spain.

stelgenhof commented 7 years ago

Yes, the main purpose of the different types was to differentiate between official/government approved holidays and other (observed, seasonal, others, etc.) type of holidays. Perhaps that needs a refactoring :)