From 383d218eb9995f8a96c1f821681f2a32e818ed42 Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 20 May 2026 14:36:23 +0530 Subject: [PATCH] feat: Add confirmation button after deadline date selection #414 --- index.html | 1 + js/app.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/index.html b/index.html index da78416..61a8f6a 100644 --- a/index.html +++ b/index.html @@ -441,6 +441,7 @@

New task

+ diff --git a/js/app.js b/js/app.js index 9bfd993..c1a0468 100644 --- a/js/app.js +++ b/js/app.js @@ -1076,3 +1076,23 @@ addItemsBtn.addEventListener('click', () => { downloadBtn.addEventListener('click', () => { downloadData(); }); +// Reference our elements +const taskDateInput = document.getElementById('new-task-date'); +const confirmDeadlineBtn = document.getElementById('confirm-deadline-btn'); + +// Show the "Confirm Date" button when a user changes/picks a date +taskDateInput.addEventListener('input', () => { + if (taskDateInput.value) { + confirmDeadlineBtn.style.display = 'inline-block'; + } else { + confirmDeadlineBtn.style.display = 'none'; + } +}); + +// Logic when the confirmation button is clicked +confirmDeadlineBtn.addEventListener('click', () => { + alert(`Deadline confirmed: ${taskDateInput.value}`); + // Hide the button again after confirmation + confirmDeadlineBtn.style.display = 'none'; +}); +