Skip to content

Commit 4508e2a

Browse files
authored
Merge pull request #1164 from RogerSelwyn/schedule.get_events_fix
Add start/end parameters to schedule.get_events
2 parents d042fae + 33111a6 commit 4508e2a

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

O365/calendar.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,9 +2098,19 @@ def get_default_calendar(self):
20982098
return self.calendar_constructor(parent=self,
20992099
**{self._cloud_data_key: data})
21002100

2101-
def get_events(self, limit=25, *, query=None, order_by=None, batch=None,
2102-
download_attachments=False, include_recurring=True):
2103-
""" Get events from the default Calendar
2101+
def get_events(
2102+
self,
2103+
limit=25,
2104+
*,
2105+
query=None,
2106+
order_by=None,
2107+
batch=None,
2108+
download_attachments=False,
2109+
include_recurring=True,
2110+
start_recurring=None,
2111+
end_recurring=None,
2112+
):
2113+
"""Get events from the default Calendar
21042114
21052115
:param int limit: max no. of events to get. Over 999 uses batch.
21062116
:param query: applies a OData filter to the request
@@ -2111,16 +2121,24 @@ def get_events(self, limit=25, *, query=None, order_by=None, batch=None,
21112121
batches allowing to retrieve more items than the limit.
21122122
:param bool download_attachments: downloads event attachments
21132123
:param bool include_recurring: whether to include recurring events or not
2124+
:param start_recurring: a string datetime or a Query object with just a start condition
2125+
:param end_recurring: a string datetime or a Query object with just an end condition
21142126
:return: list of items in this folder
21152127
:rtype: list[Event] or Pagination
21162128
"""
21172129

21182130
default_calendar = self.calendar_constructor(parent=self)
21192131

2120-
return default_calendar.get_events(limit=limit, query=query,
2121-
order_by=order_by, batch=batch,
2122-
download_attachments=download_attachments,
2123-
include_recurring=include_recurring)
2132+
return default_calendar.get_events(
2133+
limit=limit,
2134+
query=query,
2135+
order_by=order_by,
2136+
batch=batch,
2137+
download_attachments=download_attachments,
2138+
include_recurring=include_recurring,
2139+
start_recurring=start_recurring,
2140+
end_recurring=end_recurring,
2141+
)
21242142

21252143
def new_event(self, subject=None):
21262144
""" Returns a new (unsaved) Event object in the default calendar

0 commit comments

Comments
 (0)