businesstime icon indicating copy to clipboard operation
businesstime copied to clipboard

one case not working

Open lcasassa opened this issue 6 years ago • 0 comments


import businesstime

bt = businesstime.BusinessTime((time(9), time(18)), (5, 6), holidays=None)
t = bt.businesstimedelta(datetime.now(), datetime.now() + timedelta(days=1, hours=-4))
#t = bt.businesstimedelta(datetime.now() - timedelta(days=1), datetime.now() + timedelta(days=0, hours=0))
t = bt.businesstimedelta(datetime.now() - timedelta(hours=2), datetime.now() + timedelta(days=1, hours=0))
m = (float(t.days) * 9 * 60 + float(t.seconds) / 60)
h = m / 60

print h

Not working well if the two times are after business with one day of difference. It should return one business day.

lcasassa avatar Mar 02 '18 22:03 lcasassa