Closed ekampp closed 5 years ago
I was just going to post this. Just as an FYI doing
Time.first_business_day(sunday_date)
does return Monday.
As documented in many places, this is not a defect. This gem was originally used for calculating due dates of work. If you are assigned a task over a weekend, and you have one business day to work on it, that is Tuesday. If you're assigned it over a weekend and given one hour to work on it, then that is monday. Think of it as saying "this task is due in 0 days and 1 hour" vs. "this is is due in 1 day".
@bokmann, so what about the patch in #190, are you going to merge that at some point, or leave it as it is?
This is basically the same problem as reported for #111, which was closed because of #113.
However, that was a long time ago, and I'm running Ruby v. 2.5.3 and still seeing problems with determening monday as the next businessday after a weekend.
And because of the huge time and version disparity between now and the older versions, I'm opening a new ticket.
So today, as of writing this bug, it's Sunday, and I'm getting these results:
So as you can see, business hours correctly figure out that Monday is the next business day, while business days does not.