From 3e912d8ccb0f0c4b25ae49bea5b4f5dc49be6886 Mon Sep 17 00:00:00 2001 From: Maciej Buchert Date: Sun, 20 May 2018 17:22:50 +0200 Subject: [PATCH] Update calendar.py --- pyicloud/services/calendar.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pyicloud/services/calendar.py b/pyicloud/services/calendar.py index f10990a..774eea1 100644 --- a/pyicloud/services/calendar.py +++ b/pyicloud/services/calendar.py @@ -63,20 +63,20 @@ class CalendarService(object): return self.response['Event'] def calendars(self): - """ - Retrieves calendars for this month - """ - today = datetime.today() - first_day, last_day = monthrange(today.year, today.month) - from_dt = datetime(today.year, today.month, first_day) - to_dt = datetime(today.year, today.month, last_day) - params = dict(self.params) - params.update({ - 'lang': 'en-us', - 'usertz': get_localzone().zone, - 'startDate': from_dt.strftime('%Y-%m-%d'), - 'endDate': to_dt.strftime('%Y-%m-%d') - }) - req = self.session.get(self._calendars, params=params) - self.response = req.json() - return self.response['Collection'] + """ + Retrieves calendars for this month + """ + today = datetime.today() + first_day, last_day = monthrange(today.year, today.month) + from_dt = datetime(today.year, today.month, first_day) + to_dt = datetime(today.year, today.month, last_day) + params = dict(self.params) + params.update({ + 'lang': 'en-us', + 'usertz': get_localzone().zone, + 'startDate': from_dt.strftime('%Y-%m-%d'), + 'endDate': to_dt.strftime('%Y-%m-%d') + }) + req = self.session.get(self._calendars, params=params) + self.response = req.json() + return self.response['Collection']