From 1c959760c9596816591a9ad75b1658273d78f119 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Thu, 3 Apr 2014 15:14:09 +0100 Subject: [PATCH] Fix Python 2.6 support. --- businesshours/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/businesshours/core.py b/businesshours/core.py index 52a8d6d..c062bd3 100644 --- a/businesshours/core.py +++ b/businesshours/core.py @@ -33,8 +33,8 @@ def calc_business_hours(start, end, weekdays=(1, 2, 3, 4, 5), hours=range(8, 18) if end.time().hour <= hours[0]: return 0 actual_end = datetime.combine(end.date(), time(hours[-1] + 1, 0, 0)) - secs = (actual_end - actual_start).total_seconds() - return secs + delta = (actual_end - actual_start) + return delta.seconds + (delta.days * 24 * 3600) else: total_seconds = 0 dates = [dt for dt in date_range(start, end)]