Add due date functionality for reminders (#105)
This commit is contained in:
parent
69af919ad5
commit
4ec58d7950
1 changed files with 13 additions and 2 deletions
|
@ -67,7 +67,7 @@ class RemindersService(object):
|
||||||
})
|
})
|
||||||
self.lists[collection['title']] = temp
|
self.lists[collection['title']] = temp
|
||||||
|
|
||||||
def post(self, title, description="", collection=None):
|
def post(self, title, description="", collection=None, dueDate=None):
|
||||||
pguid = 'tasks'
|
pguid = 'tasks'
|
||||||
if collection:
|
if collection:
|
||||||
if collection in self.collections:
|
if collection in self.collections:
|
||||||
|
@ -80,6 +80,17 @@ class RemindersService(object):
|
||||||
'usertz': get_localzone().zone
|
'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(
|
req = self.session.post(
|
||||||
self._service_root + '/rd/reminders/tasks',
|
self._service_root + '/rd/reminders/tasks',
|
||||||
data=json.dumps({
|
data=json.dumps({
|
||||||
|
@ -96,7 +107,7 @@ class RemindersService(object):
|
||||||
"startDateTz": None,
|
"startDateTz": None,
|
||||||
"startDateIsAllDay": False,
|
"startDateIsAllDay": False,
|
||||||
"completedDate": None,
|
"completedDate": None,
|
||||||
"dueDate": None,
|
"dueDate": dueDateList,
|
||||||
"dueDateIsAllDay": False,
|
"dueDateIsAllDay": False,
|
||||||
"lastModifiedDate": None,
|
"lastModifiedDate": None,
|
||||||
"createdDate": None,
|
"createdDate": None,
|
||||||
|
|
Loading…
Reference in a new issue