Update calendar.py
This commit is contained in:
parent
73dbbceb75
commit
abbe236812
1 changed files with 18 additions and 18 deletions
|
@ -62,21 +62,21 @@ class CalendarService(object):
|
||||||
self.refresh_client(from_dt, to_dt)
|
self.refresh_client(from_dt, to_dt)
|
||||||
return self.response['Event']
|
return self.response['Event']
|
||||||
|
|
||||||
def calendars(self):
|
def calendars(self):
|
||||||
"""
|
"""
|
||||||
Retrieves calendars for this month
|
Retrieves calendars for this month
|
||||||
"""
|
"""
|
||||||
today = datetime.today()
|
today = datetime.today()
|
||||||
first_day, last_day = monthrange(today.year, today.month)
|
first_day, last_day = monthrange(today.year, today.month)
|
||||||
from_dt = datetime(today.year, today.month, first_day)
|
from_dt = datetime(today.year, today.month, first_day)
|
||||||
to_dt = datetime(today.year, today.month, last_day)
|
to_dt = datetime(today.year, today.month, last_day)
|
||||||
params = dict(self.params)
|
params = dict(self.params)
|
||||||
params.update({
|
params.update({
|
||||||
'lang': 'en-us',
|
'lang': 'en-us',
|
||||||
'usertz': get_localzone().zone,
|
'usertz': get_localzone().zone,
|
||||||
'startDate': from_dt.strftime('%Y-%m-%d'),
|
'startDate': from_dt.strftime('%Y-%m-%d'),
|
||||||
'endDate': to_dt.strftime('%Y-%m-%d')
|
'endDate': to_dt.strftime('%Y-%m-%d')
|
||||||
})
|
})
|
||||||
req = self.session.get(self._calendars, params=params)
|
req = self.session.get(self._calendars, params=params)
|
||||||
self.response = req.json()
|
self.response = req.json()
|
||||||
return self.response['Collection']
|
return self.response['Collection']
|
||||||
|
|
Loading…
Reference in a new issue