aboutsummaryrefslogtreecommitdiff
path: root/src/App.jsx
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-27 14:39:58 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-27 14:39:58 -0600
commitd0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420 (patch)
tree83d00a04beb320e68cf6ca43105b4b6b3527cc4a /src/App.jsx
parent19f07e834e68c6924e19589641e5b138b0535e53 (diff)
downloadToDo-App-FE-d0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420.tar.gz
ToDo-App-FE-d0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420.zip
If due_date is not set, don't use `substring`.
Diffstat (limited to 'src/App.jsx')
-rw-r--r--src/App.jsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/App.jsx b/src/App.jsx
index 8397a9f..832db93 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -18,7 +18,10 @@ function App() {
set_todo({
id: todo.id,
text: todo.text,
- due_date: todo.dueDate.substring(0, 16),
+ due_date:
+ todo.dueDate != null
+ ? todo.dueDate.substring(0, 16)
+ : todo.dueDate,
done: todo.done,
priority: todo.priority,
creation_date: todo.creationDate,