diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py index c7301362..28ad1fe7 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py @@ -233,8 +233,17 @@ def parse_times(data, source): start_time = data.get('uhrzeitVon') or '09:00:00' start_dt = BERLIN_TZ.localize(datetime.datetime.fromisoformat(f"{start_str}T{start_time}")) - # Use datumBis for end date if available, otherwise datum - end_date_str = data.get('datumBis', data.get('datum', '')) + # Check if this is a recurring event + is_recurring = (data.get('dauertermin', 0) == 1 and + (data.get('turnus', 0) > 0 or data.get('turnusArt', 0) > 0)) + + if is_recurring: + # For recurring events, end date is same as start date (each instance ends on same day) + end_date_str = data.get('datum', '') + else: + # Use datumBis for end date if available, otherwise datum + end_date_str = data.get('datumBis', data.get('datum', '')) + if 'T' in end_date_str: base_end_date = end_date_str.split('T')[0] else: