diff --git a/pyicloud/services/reminders.py b/pyicloud/services/reminders.py index 1c35c00..12e8ba2 100644 --- a/pyicloud/services/reminders.py +++ b/pyicloud/services/reminders.py @@ -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,