Recognizing multiday events in get_day_events
This commit is contained in:
parent
7073d5bc5d
commit
ba7c437a13
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,9 @@ class CalendarInterface (DataSourceInterface):
|
||||||
return self.get_day_events(datetime.now(timezone.utc))
|
return self.get_day_events(datetime.now(timezone.utc))
|
||||||
|
|
||||||
def get_day_events(self, date):
|
def get_day_events(self, date):
|
||||||
return self.__get_events_to_filter__(lambda x : x.begin_datetime.strftime('%d-%m-%y') == date.strftime('%d-%m-%y'))
|
if type(date) is type(datetime.now()):
|
||||||
|
date = date.date()
|
||||||
|
return self.__get_events_to_filter__(lambda x : (x.begin_datetime.date() - date) <= timedelta(0) and (x.end_datetime.date() - date) >= timedelta(0))
|
||||||
|
|
||||||
def get_month_events(self, month = -1):
|
def get_month_events(self, month = -1):
|
||||||
if month < 0:
|
if month < 0:
|
||||||
|
|
Loading…
Reference in a new issue