Add due date functionality for reminders (#105)

This commit is contained in:
Ajay Gandhi 2017-09-24 05:58:59 -07:00 committed by Tor Arne Vestbø
parent 69af919ad5
commit 4ec58d7950

View file

@ -67,7 +67,7 @@ class RemindersService(object):
})
self.lists[collection['title']] = temp
def post(self, title, description="", collection=None):
def post(self, title, description="", collection=None, dueDate=None):
pguid = 'tasks'
if collection:
if collection in self.collections:
@ -80,6 +80,17 @@ class RemindersService(object):
'usertz': get_localzone().zone
})
dueDateList = None
if dueDate:
dueDateList = [
int(str(dueDate.year) + str(dueDate.month) + str(dueDate.day)),
dueDate.year,
dueDate.month,
dueDate.day,
dueDate.hour,
dueDate.minute
]
req = self.session.post(
self._service_root + '/rd/reminders/tasks',
data=json.dumps({
@ -96,7 +107,7 @@ class RemindersService(object):
"startDateTz": None,
"startDateIsAllDay": False,
"completedDate": None,
"dueDate": None,
"dueDate": dueDateList,
"dueDateIsAllDay": False,
"lastModifiedDate": None,
"createdDate": None,