Add Support for Holidays
Do you have more detailed specs in mind for this feature ?
@msuret Hey. Thanks for the followup. So we have started to work on this.
Overall feature is the ability to add a list of "holidays" which would be full 24h "dates" which are "non-working days". So if working hours/schedule is 9am-5pm M-F and its currently Friday, and someone will take 1 business day, then it would be due at the end of Tuesday because the Monday is a holiday.
Use case is that a business hours schedule is valid "except" for "holidays". So a holiday list support would be very helpful.
We started looking at ways to extend the library to support more of the Time::Period Perl module standard and looking at a way to add a specific date support. such as Dec 25 and Jan is a holiday.
I try to implement it by adding new fields in SUPPORTED_FIELD (https://github.com/GuillaumeSmaha/business-hours-java/blob/feature/add_support_month_year/src/main/java/org/dhatim/businesshours/BusinessHoursParser.java#L56) But due to the generation for each (period - 1), it take too much time to generate few billions of periods and to merge them. So, I try to remove the call to defaultRange to only keep the updated range. I created a PR https://github.com/dhatim/business-hours-java/pull/7 to show you my draft.
Also, I was blocked to insert month and year due to the calculation of duration (year and month can have different values in seconds).
@GuillaumeSmaha Thanks, I'm a bit busy this week-end but I'll have a look asap !