Skip to content

Trouble understanding results #149

Description

@rcrisp

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions