Fix bug where calendar caching meant invalid duration calculations if you edited your calendar after a date calculation.

This commit is contained in:
Dion Moult
2023-02-03 10:06:55 +11:00
parent be26a77ecb
commit f72d48aab5
5 changed files with 65 additions and 4 deletions
@@ -18,6 +18,7 @@
import ifcopenshell.api
import ifcopenshell.util.date
import ifcopenshell.util.sequence
from datetime import datetime
from datetime import timedelta
@@ -93,4 +94,8 @@ class Usecase:
time_periods = list(self.settings["recurrence_pattern"].TimePeriods or [])
time_periods.append(time_period)
self.settings["recurrence_pattern"].TimePeriods = time_periods
ifcopenshell.util.sequence.is_working_day.cache_clear()
ifcopenshell.util.sequence.is_calendar_applicable.cache_clear()
return time_period