azuyalabs / yasumi

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

"Fronleichnam" missing as official Holiday #252

Closed pete1019 closed 3 years ago

pete1019 commented 3 years ago

Hi,

"Fronleichnam" is missing as official holiday today. Why is that? Not listed in NRW nor Bayern. Don't know if others are missing, too.

Thanks a lot

stelgenhof commented 3 years ago

Hi, Could you share some sample code that shows the holiday is missing? Thanks!

pete1019 commented 3 years ago

Sure:

` ... $official = new Yasumi\Filters\OfficialHolidaysFilter($ho->getIterator()); foreach ($official as $h) { if (strval($d) === strval($h)) die('isholiday'); } die("notholiday"); .... }

`

And this is the List for NRW: 2021-01-01: newYearsDay 2021-04-02: goodFriday 2021-04-05: easterMonday 2021-05-01: internationalWorkersDay 2021-05-13: ascensionDay 2021-05-24: pentecostMonday 2021-10-03: germanUnityDay 2021-12-25: christmasDay 2021-12-26: secondChristmasDay

And today is missing for "Hessen" and "Bayern" as well...maybe others, too.

Thanks!

stelgenhof commented 3 years ago

Thanks for the example. I just found out that Corpus Christi is by default set to 'Other' which is likely the most sensible classification for any country that celebrates it. This is the case for Germany (and it's states) as well. Hence why these don't show up.

A reclassification for the respected states is then necessary in Yasumi.

pete1019 commented 3 years ago

Thanks. When might a fix be available?

github-actions[bot] commented 3 years ago

Since this issue has not had any activity within the last 90 days, I have marked it as stale. I will close it if no further activity occurs within the next 10 days.

pete1019 commented 3 years ago

Hi, any news on this? Thanks a lot

Fronleichnam wird in folgenden Bundesländern als Feiertag begangen:

-Baden Württemberg -Bayern -Hessen -Nordrhein-Westfalen -Rheinland-Pfalz -Saarland

stelgenhof commented 3 years ago

I will look into it this week. Thanks for the reminder!

stelgenhof commented 3 years ago

@pete1019 I have created a PR that will fix this issue. If you like to verify, please have a look at this PR.

pete1019 commented 3 years ago

Thanks, how can i download and check?

stelgenhof commented 3 years ago

You can checkout the fronleichnam-fix branch.

pete1019 commented 3 years ago

ahh you mean this: https://github.com/azuyalabs/yasumi/tree/fronleichnam-fix

okay i will test it and let you know.

pete1019 commented 3 years ago

i tried downloading the code.zip and tried to replace the src folder but i got and internal server error. I had it working with composer before. How to get the fix "composer-friendly"? PHP 7.2

Thanks

stelgenhof commented 3 years ago

@pete1019 I don't think that would work indeed. If you want to go the Composer route, you would need to change the Yasumi version in your composer.json with the desired branch (see: https://getcomposer.org/doc/articles/aliases.md#why-aliases-)

You can also checkout the branch with Git and have your script point to that.

pete1019 commented 3 years ago

@stelgenhof thanks and how will i deal with this on 2.4.0?

I can not upgrade PHP 7.2 at this point.

Is your fix only available for 2.4.0 which does not have PHP 7.2 support anymore? https://github.com/azuyalabs/yasumi/tree/fronleichnam-fix

THANKS!

stelgenhof commented 3 years ago

@pete1019 It will be fixed in the upcoming 2.5.0 release. 2.4 and 2.5 have support for PHP7.3 or higher as these are the official supported PHP versions.

pete1019 commented 3 years ago

@stelgenhof so i am out of luck with PHP 7.2 for now? I need to upgrade to 7.3? You used special PHP 7.3 functions or is it just coded that PHP 7.2 is not allowed to use with YASUMI anymore? Thanks.

stelgenhof commented 3 years ago

@pete1019 Don't know by heart but probably some specific 7.3 syntax indeed is used since 2.4.

stelgenhof commented 3 years ago

@pete1019 Were you able to do some checks?

pete1019 commented 3 years ago

@stelgenhof unfortunately not since the PBX i am using it on still is on PHP 7.2. Hope at least PHP 7.3 in the next weeks / months.

stelgenhof commented 3 years ago

@pete1019 I went ahead and merging your PR. I am aware you may not have time yet to check everything, however if we find some issues we can always fix them at any time.