-
Notifications
You must be signed in to change notification settings - Fork 25
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
Calculate Number of Business Days between Two Dates #8
Comments
Hi If the API takes 2 days:
Probably need more examples, what do you think? Benoit |
Good question. You'd know better how ye view rounding up / down, but to take it as how many business days between 12:00am on A to 12:00am on B, I would see that returning 1. |
My thoughts were only to deal with dates avoiding the time issues: LocalDate, Date, Calendar and JDK8 LocalDate. The semantics are not that clear: getNumberOfBusinessDaysBetween(d1, d2); I'll have a look at what JODA does for something similar (but not taking into weekends/holidays) and then eliminate BOTH d1 and d2 if they are holidays. Thinking about this, it might be easiest to loop between the dates...unless the holidays are sorted internally. Never mind...that is implementation details. You'll have to give me a bit of time for this, very busy with business. |
Oh I am not in a rush for it at all, I'm using a variant of the code I posted in the StackOverflow link. [I totally get the desire to avoid the JODA/java.util.date mess, your work is great :-D] |
Hello, I know this thread is 5 years old but I was wondering if there is any update on this ? Thank you |
Hi
I'd welcome a patch as I'm very busy at the moment... many thanks.
Benoit
…On Tue, 14 May 2019 at 23:54, ailes17 ***@***.***> wrote:
Hello,
I know this thread is 5 years old but I was wondering if there is any
update on this ?
Having the business days number between two dates (applying on them the
holidays list) might come very handy.
Thank you
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8?email_source=notifications&email_token=AAB542NK6F7ITJFEKYLAR3LPVM7L5A5CNFSM4AWCFCJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVNAXFQ#issuecomment-492440470>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB542OQHFLHSLP74F53UXLPVM7L5ANCNFSM4AWCFCJQ>
.
|
let's come up with a spec:
Agreed? |
ok, I need your help. What do you think the results should be? Assume that:
|
Hello Benoit, Sorry I just saw your messages. We use your framework in our code and this reverse engineer calculation would be more than welcome. Thank you |
Excellent idea and it kind of solve some issues when you need a handler to know if you should move backward or forward. If I do a snapshot release, would you be willing to test it? Thanks. |
Sure, |
issue #8 First cut at the getNumberOfBusinessDaysBetween method.
A snapshot is available at the repo: |
Hello
Have you had a chance to try it? Is it working for you now?
Many thanks
Benoit
…On Wed, 22 May 2019 at 23:35, ailes17 ***@***.***> wrote:
Sure,
I'll give it a try.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8?email_source=notifications&email_token=AAB542IOQRYPXTXQDRAFUK3PWXDC3A5CNFSM4AWCFCJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWAROJY#issuecomment-494999335>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB542JTXEI732ILXVCH57DPWXDC3ANCNFSM4AWCFCJQ>
.
|
It would be very useful if one could query their DateCalculator and ask it for the number of business days that occur between two dates, obeying the calendar rules that the developer has built into their instance of DateCalculator.
Similar to the code found here:
http://stackoverflow.com/questions/4600034/calculate-number-of-weekdays-between-two-dates-in-java
The text was updated successfully, but these errors were encountered: