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 Support for Holidays #3

Open
StephenOTT opened this issue Dec 7, 2017 · 4 comments
Open

Add Support for Holidays #3

StephenOTT opened this issue Dec 7, 2017 · 4 comments

Comments

@StephenOTT
Copy link

No description provided.

@msuret
Copy link

msuret commented Dec 14, 2017

Do you have more detailed specs in mind for this feature ?

@StephenOTT
Copy link
Author

@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.

@GuillaumeSmaha
Copy link

GuillaumeSmaha commented Dec 15, 2017

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 #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).

@msuret
Copy link

msuret commented Dec 16, 2017

@GuillaumeSmaha Thanks, I'm a bit busy this week-end but I'll have a look asap !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants