in src/guclimate/core/parse_input.py [0:0]
def parseTimeRange(input: str):
pattern = re.compile(r"^[0-9]{2}:[0-9]{2}\s?-\s?[0-9]{2}:[0-9]{2}$")
if pattern.match(input) is None:
return None
[start, end] = input.split("-")
start_time = time.fromisoformat(start)
end_time = time.fromisoformat(end)
if start_time > end_time:
raise ValueError("Start time must be before end time")
range = []
current_time = start_time
while current_time <= end_time:
range.append(current_time.isoformat(timespec="minutes"))
if current_time.hour < 23:
current_time = current_time.replace(hour=current_time.hour + 1)
else:
break
return range