azuyalabs / yasumi

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

Refactored the rules for calculating holidays in South Korea based on the history of holiday changes. #314

Closed barami closed 1 year ago

barami commented 1 year ago

@stelgenhof Hi there. It's been a while.

Recently, the South Korean government passed a bill designating Christmas and Buddha's Day as alternative holidays.

In response, we modified the code for calculating alternative holidays and refactored the scattered and hard-to-understand structure into one that follows the changes over the years.

Here are the changes we made

  1. Updated the KASI documentation reference link in the SouthKorea Provider note and added a link to the conversion utility.
  2. Added alternative holidays (Buddha's Day, Christmas).
  3. Added a generator method to create an instance of a holiday, such as the CommonHolidays trait.
  4. Collected the names of each holiday in one place and organized them into a HOLIDAY_NAMES constant.
  5. Fixed an incorrect date for Buddha's Birthday in 2001.
  6. Fixed an incorrect year for Chuseok in 1995.
  7. Fixed the years that Armed Forces Day is included as a public holiday
  8. Added the 1959, 1960, and 1989 cases to the 'calculateOldSubstituteHolidays' method.
  9. Fixed overall unit tests for the SouthKorea provider.
  10. Adding unit tests for United Nations Day.

Best regards.

stelgenhof commented 1 year ago

@barami Thanks for this PR. Are all your changes done? I will then review it. There are some pipeline errors but these are not related to your changes.

barami commented 1 year ago

@barami Thanks for this PR. Are all your changes done? I will then review it. There are some pipeline errors but these are not related to your changes.

@stelgenhof Sorry, I've been a little busy lately and haven't gotten around to changing the unit tests. I'll change the unit test, commit it, and let you know in the comments.

barami commented 1 year ago

@stelgenhof

Thank you for your wait. I've made all the fixes and will write another PR if there are any other fixes in the future.

stelgenhof commented 1 year ago

@barami Sorry I missed your last message. I'll have a look this weekend. Thanks for all the work!

barami commented 1 year ago

Can you update the CHANGELOG file as well? Thanks!

Thanks for your review. I've updated the CHANGELOG file.

barami commented 1 year ago

There is a conflict with a recent change in the upstream commit, so we rebase and request again. Thanks.