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

Trouble understanding results #149

Open
rcrisp opened this issue Jan 16, 2017 · 2 comments
Open

Trouble understanding results #149

rcrisp opened this issue Jan 16, 2017 · 2 comments

Comments

@rcrisp
Copy link

rcrisp commented Jan 16, 2017

I seem to be having some issues with business_time. I'm not sure if I'm not using it properly or not understanding the results properly. Can you explain how this result occurs?

2.3.1 :031 > d1 = DateTime.parse('2017-01-07 19:55:29.842345')
 => Sat, 07 Jan 2017 19:55:29 +0000 
2.3.1 :032 > 3.business_days.after(d1)
 => Fri, 13 Jan 2017 09:00:00 +0000 

I would expect 3 business days to be January 11th. I have no idea how this results in the 13th. Even more confusing, a later starting date (2 days later, Jan 9th 00:00), considers 3 business days from that date to be earlier than the previous date (Jan 7th).

2.3.1 :039 > d2 = DateTime.parse('2017-01-09 00:00:00.000000')
 => Mon, 09 Jan 2017 00:00:00 +0000 
2.3.1 :040 > 3.business_days.after(d2)
 => Thu, 12 Jan 2017 09:00:00 +0000 

I'm guessing this has something to do with the time. Seems like a bug, or am I missing something?

@xlts
Copy link
Contributor

xlts commented Feb 7, 2017

@ryancrisp It's a known 'issue' which was discussed some time ago, see: #116. As you can see, numerous issues have been opened to address this rather unintuitive behaviour but it doesn't seem like it's going to be changed anytime soon.

@bokmann
Copy link
Owner

bokmann commented Mar 6, 2017

this is different than #116 and seems like a real bug. both of your test cases should result in the Thursday date.

will investigate.

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