seatgeek / businesstime

A simple python utility for calculating business time aware timedeltas between two datetimes
BSD 2-Clause "Simplified" License
85 stars 36 forks source link

Accomodate for early workers #6

Closed pilz closed 10 years ago

pilz commented 10 years ago

Hi,

thanks for this package, this has saved me today. Working early in the morning, I found one hole, I guess.

The code checks for the case that the time delta starts after business hours. Extending the check to also check of the delta actually stops before before business hours.

If that doesn't happen, a timespan in the early hours will have the whole day get counted.

Best! Alex

josegonzalez commented 10 years ago

This also needs tests before it can be merged.

erwaller commented 10 years ago

@pilz thanks for this! After thinking about it for a bit, I'm pretty sure we needed to just special case the scenario where you've got two datetimes on the same day, both before business hours. I made that change, with some tests, here: 5c4bd1043e4c497a5095415d139a31894d944acf

pilz commented 10 years ago

Wonderful, thanks a million. I am task switching as crazy here and had looking at the tests on my list, so I am extremely happy you actually did it already :)