diff options
Diffstat (limited to 'calendar_manager.py')
| -rw-r--r-- | calendar_manager.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/calendar_manager.py b/calendar_manager.py index 9ef6596..f6ec0db 100644 --- a/calendar_manager.py +++ b/calendar_manager.py @@ -4,7 +4,7 @@ import uuid from datetime import datetime class CalendarEntry: - def __init__(self, start_date, end_date, keyword, entry_id=None, corrected_start_date=None, corrected_end_date=None, commentary: str = ""): + def __init__(self, start_date, end_date, keyword, entry_id=None, corrected_start_date=None, corrected_end_date=None, time_period=None, commentary: str = ""): self.id = entry_id if entry_id else str(uuid.uuid4()) # Convert string dates to datetime if necessary self.start_date = ( @@ -20,6 +20,7 @@ class CalendarEntry: self.keyword = keyword self.corrected_start_date = corrected_start_date self.corrected_end_date = corrected_end_date + self.time_period = time_period self.commentary = commentary def to_dict(self): return { @@ -135,9 +136,13 @@ class CalendarManager: for entry in self.entries: entry.corrected_start_date = None entry.corrected_end_date = None + entry.time_period = None for start_date, end_date, original_id in list_of_events: entry = self.get_entry_by_id(original_id) + if not entry: + continue + entry.corrected_start_date = start_date entry.corrected_end_date = end_date |
