aboutsummaryrefslogtreecommitdiff
path: root/src/App.jsx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/App.jsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/App.jsx b/src/App.jsx
index 832db93..6f1b14f 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -14,14 +14,19 @@ function App() {
const dispatch = useDispatch();
function handler(data) {
data.map((todo) => {
+ const due_date = new Date(todo.dueDate);
+ const offset = due_date.getTimezoneOffset();
+
dispatch(
set_todo({
id: todo.id,
text: todo.text,
due_date:
todo.dueDate != null
- ? todo.dueDate.substring(0, 16)
- : todo.dueDate,
+ ? new Date(due_date - offset * 60 * 1000)
+ .toISOString()
+ .slice(0, -1)
+ : "",
done: todo.done,
priority: todo.priority,
creation_date: todo.creationDate,