spatie / holidays

Calculate which days you don't have to work!
https://spatie.be/open-source
MIT License
328 stars 196 forks source link

Improve Switzerland #195

Closed herpaderpaldent closed 7 months ago

herpaderpaldent commented 8 months ago

Improve Switzerland

This pull requests aims to resolve https://github.com/spatie/holidays/issues/193 and adds various imrovements whilst refactoring the code to make it more maintainable.

Whilst the original implementation relied on wikipedia. This pull request implements the holidays communicated by the federal bureau of justice FOJ.

Nielsvanpach commented 8 months ago

maintainability: use English as default language (not German)

I do prefer it to return the most general language by default.

$holidays = Holidays::for('ch')->get(); // German by default instead of English
Nielsvanpach commented 8 months ago

refactor: instead of maintaining a large array, the regions/cantons are split in individual functions making them easier to maintain and update.

I don't really agree this solution is more readable and easier to maintain

Nielsvanpach commented 7 months ago

Thanks for your efforts and feel free to reopen if you're still planning to update this PR!