diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-27 14:39:58 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-27 14:39:58 -0600 |
commit | d0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420 (patch) | |
tree | 83d00a04beb320e68cf6ca43105b4b6b3527cc4a /src | |
parent | 19f07e834e68c6924e19589641e5b138b0535e53 (diff) | |
download | ToDo-App-FE-d0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420.tar.gz ToDo-App-FE-d0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420.zip |
If due_date is not set, don't use `substring`.
Diffstat (limited to 'src')
-rw-r--r-- | src/App.jsx | 5 |
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, |