Skip to content

Commit

Permalink
fixed datetime bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasJoKuJonas committed Sep 11, 2023
1 parent 873f987 commit 4022c4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/webuntis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,14 @@ def get_timetable_object(self):

return {self.timetable_source: source}

def get_timetable(self, start, end):
def get_timetable(self, start, end: datetime):
"""Get the timetable for the given time period"""
timetable_object = self.get_timetable_object()

start_schoolyear = get_schoolyear(self.school_year, start)

if start_schoolyear:
if start_schoolyear.end.date() < end.date():
if start_schoolyear.end.date() < end:
end = start_schoolyear.end.date()

if self.extended_timetable:
Expand Down Expand Up @@ -642,7 +642,7 @@ def _get_events(self):
def _get_events_in_timerange(
self, start, end, filter_on, show_cancelled=True, compact_result=True
):
table = self.get_timetable(start=start.date(), end=end)
table = self.get_timetable(start=start.date(), end=end.date())

events = []

Expand Down

0 comments on commit 4022c4b

Please sign in to comment.