-
Notifications
You must be signed in to change notification settings - Fork 215
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
business_day.after does not handle starting time outside business hours properly #45
Comments
This is correct behavior. Here's what happens:
This matches the real world scenario of a company saying "We will process your paperwork within one business day", and has mail delivery on Saturday. The busines day clock doesn't start until Monday morning for the mail that arrived Saturday. |
The date was not the issue, the time was. The resulting time is 00:54:00 which is not inside business hours. The rest of your logic I follow and agree with… but the resulting time is not correct. Note that using business_hours.after() works fine, it is just business_days.after() that does not. |
Hmm... I agree, this seems like a real issue. |
this may be related to issue #83 |
…Ensure we wind to beginning of business day when using business_hours before/after methods
The latest version of business_time does not seem to handle calculating business_days.after() based on a date/time that starts outside business hours.
An example:
irb(main):001:0> d=Time.parse("Saturday, August 17, 12:54am")
=> Sat Aug 17 00:54:00 -0700 2013
irb(main):002:0> 1.business_day.after(d)
=> Tue, 20 Aug 2013 00:54:00 PDT -07:00
It seems that business_days.after is completely ignoring the time, which seems to be wrong. It also seems to have the day off by one as 1 business day after should be the EOBD on Monday.
The text was updated successfully, but these errors were encountered: