holidays / holidays

A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DatesDriverBuilder does not work properly with Lunar calendar

JosefuMealsom opened this issue · comments

Hey,

I've just been looking at adding Chinese Holidays to the definitions, but have found the DatesDriverBuilder doesn't work with the Lunar calendar.

Within my cn.yaml file, (which was based off this pr here) the 中秋节 (Mid-autumn festival) occurs in the 8th lunar month, which usually falls in September but occasionally at the start of October.
The Holidays::Finder::Context::DatesDriverBuilder returns an array of months which includes the current month and the months around it. When this Holiday falls in October, it doesn't get returned in the list of dates since the Gregorian month is 10 and the Lunar month is 8.

I suspect that this is the case for the Vietnamese and Korean holidays as well, so we should probably add additional tests to see if any other holidays are affected.

Let me know if there is a way around this, something that I've missed, or if you have trouble understanding the way I've described the issue!