From a96e7d97ac92feb238fc48bad2ea9c43318625e5 Mon Sep 17 00:00:00 2001 From: "Sigma Dimensions (Yass)" <79010126+myoualid@users.noreply.github.com> Date: Wed, 20 Sep 2023 01:11:42 +0100 Subject: [PATCH] fix count_working_days when the start and finish are the same same hours --- src/ifcopenshell-python/ifcopenshell/util/sequence.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/util/sequence.py b/src/ifcopenshell-python/ifcopenshell/util/sequence.py index 9389320120..a97e9a58a1 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/sequence.py +++ b/src/ifcopenshell-python/ifcopenshell/util/sequence.py @@ -62,6 +62,8 @@ def derive_calendar(task): def count_working_days(start, finish, calendar): result = 0 + if start == finish: + return 0 current_date = datetime.date(start.year, start.month, start.day) finish_date = datetime.date(finish.year, finish.month, finish.day) while current_date <= finish_date: