azuyalabs / yasumi

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

Add England, Wales, Scotland, Northern Ireland #166

Closed c960657 closed 5 years ago

c960657 commented 5 years ago

Public holidays are defined differently in England, Wales, Northern Ireland and particularly Scotland.

I have tried to implement providers for each of these countries based on Wikipedia (UK and Scotland), official sources (1, 2, 3), newspaper articles (4, 5) and other online sources (6, 7).

The providers for England and Wales are identical to the existing United Kingdom provider, including the unit tests. The provider for Northern Ireland is nearly identical except that it adds to holidays. The provider for Scotland is completely different (it does not call parent::initialize().

Northern Ireland did not exist as a country prior to 1921 (neither did the Republic of Ireland), but I haven't added special handling of this. I assume that the territory that is currently Northern Ireland followed the same rules as England and Wales prior to then.

Like the United Kingdom provider, these providers miss translations for substitute holidays. This issue has been addressed in PR #162.

stelgenhof commented 5 years ago

Hi @c960657 I am reviewing this PR and like to include it in the next v2.2 release that I am planning (likely before the end of this month). Would you like to use the SubstituteHoliday class in this PR or merge it without?

Cheers! Sacha

c960657 commented 5 years ago

I merged the SubstituteHoliday change into the united-kingdom branch a few days ago, but I did not realise that this branch introduces some new substitute holidays that should be updated to the new pattern.

It's fixed now :-)