Skip to content

Commit e55c09c

Browse files
authored
Merge pull request #1167 from RogerSelwyn/docs_for_get_events_breaking_change
Update calendar docs for upcoming breaking change
2 parents 5b9af3c + 3528081 commit e55c09c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/source/usage/calendar.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,15 @@ Working with Calendar instances:
4949
calendar.name = 'Football players birthdays'
5050
calendar.update()
5151
52-
q = calendar.new_query('start').greater_equal(dt.datetime(2018, 5, 20))
53-
q.chain('and').on_attribute('end').less_equal(dt.datetime(2018, 5, 24))
52+
53+
start_q = calendar.new_query('start').greater_equal(dt.datetime(2018, 5, 20))
54+
end_q = calendar.new_query('start').less_equal(dt.datetime(2018, 5, 24))
5455
55-
birthdays = calendar.get_events(query=q, include_recurring=True) # include_recurring=True will include repeated events on the result set.
56+
birthdays = calendar.get_events(
57+
include_recurring=True, # include_recurring=True will include repeated events on the result set.
58+
start_recurring=start_q,
59+
end_recurring=end_q,
60+
)
5661
5762
for event in birthdays:
5863
if event.subject == 'George Best Birthday':
@@ -65,7 +70,10 @@ Working with Calendar instances:
6570

6671
1. Include_recurring=True:
6772

68-
It's important to know that when querying events with include_recurring=True (which is the default), it is required that you must provide a query parameter with the start and end attributes defined. Unlike when using include_recurring=False those attributes will NOT filter the data based on the operations you set on the query (greater_equal, less, etc.) but just filter the events start datetime between the provided start and end datetimes.
73+
It's important to know that when querying events with include_recurring=True (which is the default),
74+
it is required that you must provide start and end parameters, these may be simple date strings, python dates or individual queries.
75+
Unlike when using include_recurring=False those attributes will NOT filter the data based on the operations you set on the query (greater_equal, less, etc.)
76+
but just filter the events start datetime between the provided start and end datetimes.
6977

7078
2. Shared Calendars:
7179

0 commit comments

Comments
 (0)