From 2a86dffc9341c9730e5c789ab4c0c7c1e2cefff5 Mon Sep 17 00:00:00 2001 From: zenggang Date: Mon, 23 Aug 2021 14:13:10 +0800 Subject: [PATCH] * Adjust todo api --- api/v1/entries/todo.php | 4 +++- api/v1/entries/todos.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/v1/entries/todo.php b/api/v1/entries/todo.php index 82d5d56619..05484741ee 100644 --- a/api/v1/entries/todo.php +++ b/api/v1/entries/todo.php @@ -27,7 +27,9 @@ class todoEntry extends entry $this->batchSetPost($fields, $oldTodo); $this->setPost('idvalue', 0); - $this->setPost('date', date("Y-m-d", strtotime($oldTodo->date))); + $this->setPost('date', $this->request('date', date("Y-m-d", strtotime($oldTodo->date)))); + $this->setPost('begin', $this->request('begin') ? str_replace(':', '', $this->request('begin')) : $oldTodo->begin); + $this->setPost('end', $this->request('end') ? str_replace(':', '', $this->request('end')) : $oldTodo->end); $control = $this->loadController('todo', 'edit'); $control->edit($todoID); diff --git a/api/v1/entries/todos.php b/api/v1/entries/todos.php index 3b7a19728e..a082536068 100644 --- a/api/v1/entries/todos.php +++ b/api/v1/entries/todos.php @@ -33,8 +33,10 @@ class todosEntry extends entry $this->setPost('date', $this->request('date', date("Y-m-d"))); $this->setPost('type', $this->request('date', 'custom')); - $this->setPost('pri', $this->request('pri', '3')); $this->setPost('status', $this->request('status', 'wait')); + $this->setPost('begin', str_replace(':', '', $this->request('begin'))); + $this->setPost('end', str_replace(':', '', $this->request('end'))); + $this->setPost('pri', $this->request('pri', '3')); $control = $this->loadController('todo', 'create'); $this->requireFields('name');