From 2bb4e645b2810ec5760532fede3b9e26469dbfbd Mon Sep 17 00:00:00 2001 From: Sigma Dimensions <79010126+myoualid@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:19:57 +0100 Subject: [PATCH] Fix: When counting working days, consider if calendar is applicable --- src/ifcopenshell-python/ifcopenshell/util/sequence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/sequence.py b/src/ifcopenshell-python/ifcopenshell/util/sequence.py index 74ac4e2f6f..96bc2e51f7 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/sequence.py +++ b/src/ifcopenshell-python/ifcopenshell/util/sequence.py @@ -45,7 +45,7 @@ def count_working_days(start, finish, calendar): and is_working_day(current_date, calendar) ): result += 1 - elif not calendar: + elif not calendar or not is_calendar_applicable(current_date, calendar): result += 1 current_date += datetime.timedelta(days=1) return result