Skip to content

Commit

Permalink
final attempt in fixing the calendar plugin for all-day events
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTheNerd committed Nov 20, 2024
1 parent bcdeab9 commit 983f748
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions plugins/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ def get_event_key(self, event):
event_start = event.get("DTSTART").dt
if isinstance(event_start, datetime.date):
event_start = datetime.datetime.combine(event_start, datetime.time(0, tzinfo=self.local_tz))
if hasattr(event_start, 'astimezone'):
event_start = event_start.astimezone(self.local_tz)
return abs((event_start - utc_now).total_seconds())

def get_documents(self):
Expand Down Expand Up @@ -132,7 +130,6 @@ def get_llm_prompt_addition(self, selected_categories, user_prompt):
if day not in days_with_events:
days_without_events.append(day)

utc_now = datetime.datetime.now()
closest_event = min(self.calendar_events, key=self.get_event_key)

closest_event_start = closest_event.get("DTSTART").dt
Expand Down

0 comments on commit 983f748

Please sign in to comment.