From 8a9c24b9f95257b95327e8103059741b1e47f54f Mon Sep 17 00:00:00 2001 From: Anurag Narula Date: Sat, 12 Oct 2024 12:26:21 +0530 Subject: [PATCH 1/2] Fixed date and time Fields when updating any entry --- script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 61925a0..90261ec 100644 --- a/script.js +++ b/script.js @@ -99,8 +99,9 @@ function updateTodo(index) { // Clear the input fields inputNameElement.value = ''; - inputDateElement.value = ''; - inputTimeElement.value = ''; + + // Set default date and time + setDefaultDateTime(); // Change the update button back to an add button const addButton = document.querySelector('.js-add-button'); From 304e4e06e50f747ac1d3aed36953697182b73389 Mon Sep 17 00:00:00 2001 From: Anurag Narula Date: Sat, 12 Oct 2024 12:54:04 +0530 Subject: [PATCH 2/2] Ran format script --- script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index b65de8f..2c504e2 100644 --- a/script.js +++ b/script.js @@ -102,11 +102,11 @@ function updateTodo(index) { // Update local storage localStorage.setItem('todoList', JSON.stringify(todoList)); - // Clear the input fields - inputNameElement.value = ''; + // Clear the input fields + inputNameElement.value = ''; - // Set default date and time - setDefaultDateTime(); + // Set default date and time + setDefaultDateTime(); // Change the update button back to an add button const addButton = document.querySelector('.js-add-button');