Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add china national holidays #171

Closed
wants to merge 1 commit into from
Closed

add china national holidays #171

wants to merge 1 commit into from

Conversation

philihp
Copy link

@philihp philihp commented Jun 22, 2020

Sorry for the delay; CNY and Golden Week (as far as I could tell) aren't standardized to when people take off, so I ended up using a custom holidays file that listed 14 days before and 14 days after CNY, and 7 days (instead of 3) for Golden week, which is about when our factories were mostly non-operational.

Here's a slimmed down version of what we used, with only the dates listed in https://en.wikipedia.org/wiki/Public_holidays_in_China; Qīngmíng jié was simplified to just 15 days after the vernal equinox, which is equivalent, and simpler than finding the first day of the fifth solar term of the traditional Chinese lunisolar calendar.

Resolves #112

@JosefuMealsom
Copy link

JosefuMealsom commented Jul 1, 2020

Hey!

Thanks for your help, and sorry for the late reply.

Just a couple of things I noticed after testing locally.

  • When we are checking for the holidays (ie via Holidays.on(Date.civil(2008, 4, 25), :cn)), it runs Holidays::DateCalculator::LunarDate in the Holidays repo. Here it requires that there is a map for the Chinese Lunar calendar. Is this something you added while testing locally?
  • Since we are adding another country definition, do we need to update the tests in Holidays, namely around the number of definition files it expects?

@philihp
Copy link
Author

philihp commented Jul 1, 2020

Hi!

I used lunar_to_solar, as in kr, Is this not correct?

I ran the rake test command on this PR and the tests came back green. I don't know what else needs to be updated. (apologies, I can't run this again; I had to delete a bunch of things locally to clear space)

@JosefuMealsom
Copy link

Hey,

After investigating further, I think you can close this PR, due to the somewhat complicated nature of the Chinese holidays. Some changes would need to be made inside the Holidays repo for it to work correctly as well; it currently doesn't deal with lunar dates correctly in some cases.

Thanks for your help!

@philihp
Copy link
Author

philihp commented Jul 14, 2020

What are the next steps? Update the built-in method? I could just pre-compute these, as was done with vernal_equinox. Or we could just roll with a subset of the holidays based on solar calendar, and add those in with another PR.

@bkmgit
Copy link
Contributor

bkmgit commented Mar 6, 2022

Maybe it is better to update the code to support holidays from more regions? In addition to Chinese holidays, Islamic holidays and Hindu holidays such as Diwali would be nice additions.

@ppeble
Copy link
Member

ppeble commented Aug 11, 2024

I am going to close this just because of the inactivity. I think this is a worthy thing to add....but unfortunately it's simply not easy to do with the current setup. We need a more comprehensive solution to holidays in other date formulations. Please post in this thread if you disagree and I will be happy to reopen to discuss further.

@ppeble ppeble closed this Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chinese holidays
4 participants