azuyalabs / yasumi

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

Implement Indonesian public holidays #24

Closed agungsijawir closed 4 years ago

agungsijawir commented 8 years ago

Hi,

I am from reddit/r/php whom ask you how can i contribute in Indonesian public Holidays.

In Indonesian, there are several public holidays based on Hijri calendar, Hindus calendar, etc. Based on that, is there a way to perform calculation Hijri calendar, Hindus calendar, etc?

Or should I add "common" public holidays only?

stelgenhof commented 8 years ago

Hi @agungsijawir Let me have a look what type of holidays these are. Generally speaking, the common holiday class is designed for global common holidays like New Years Day for example (Non-religious holidays). Anything outside that should either be in the provider class itself or a (new) class. A separate class should only be made if the holidays defined in there are applicable to other countries/subdivisions as well.

stelgenhof commented 8 years ago

Hi @agungsijawir Sorry for the late reply. I had a look at those calendars and I think it's not too difficult. Basically Yasumi represents all holidays according to the Gregorian calendar, so if any holidays based on Hijri, Hindus, etc. can be converted to Gregorian dates, then it is perfectly fine.

I recommend these not to add to the common public holidays, but better to create a separate base/common provider specific for Hijri, Hindus separately.

Let me know if you need any help!

dimasdanz commented 8 years ago

I'm interested on contributing Indonesian Holidays too. For starts, I'd like to add IslamicHolidays trait since Indonesia have it. I don't see yasumi has test for ChristianHolidays trait, should I just add IslamicHolidays trait without test?

stelgenhof commented 8 years ago

Hi @Dimasdanz There are indeed no specific unit tests for the Christian Holidays. Each Holiday Provider should implement its own holiday tests, mainly that even some Christian Holidays occur on the same date, in some countries it can be different.

As for Indonesia, the challenge is that Yasumi is based on calendars that have arithmetic bases, like the Gregorian calendar. This is the base calendar of Yasumi. Some other calendars (e.g. Islamic, Chinese, etc.) have a different basis.

github-actions[bot] commented 4 years ago

This issue has been open 60 days with no activity. Please remove the stale label or comment, or this will be closed in 10 days.