Added week events support to IcalEvents
This commit is contained in:
parent
4c2c049c4b
commit
856e7b5b94
1 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,11 @@ class IcalEvents(CalendarInterface):
|
||||||
return self.__get_events_to_filter__(lambda x : x.begin_datetime.month == month)
|
return self.__get_events_to_filter__(lambda x : x.begin_datetime.month == month)
|
||||||
|
|
||||||
def get_week_events(self, week = -1):
|
def get_week_events(self, week = -1):
|
||||||
raise NotImplementedError("Malfunctioning")
|
if week < 0 and week_starts_on == "Monday":
|
||||||
|
week = int(datetime.now().strftime('%W')) + 1
|
||||||
|
elif week < 0:
|
||||||
|
week = int(datetime.now().strftime('%U')) + 1
|
||||||
|
|
||||||
if week_starts_on == "Monday":
|
if week_starts_on == "Monday":
|
||||||
return self.__get_events_to_filter__(lambda x : int(x.begin_datetime.strftime('%W')) + 1 == week)
|
return self.__get_events_to_filter__(lambda x : int(x.begin_datetime.strftime('%W')) + 1 == week)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue