Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ <h3 style="margin:0 0 12px; font-size:18px; font-weight:600;">New task</h3>

<label style="display:block; font-size:12px; margin-bottom:4px;">Deadline</label>
<input id="new-task-date" type="datetime-local" style="width:100%; padding:6px; margin-bottom:10px;" placeholder="Deadline">
<button type="button" id="confirm-deadline-btn" class="btn" style="padding:4px 8px; font-size:11px; margin-top:4px; display:none;">Confirm Date</button>

<!-- <label style="display:block; font-size:12px; margin-bottom:4px;">Notes</label> -->
<input id="new-task-notes" type="text" style="width:100%; padding:6px; margin-bottom:16px;" placeholder="Notes">
Expand Down
25 changes: 24 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,28 @@ pasteInput.addEventListener('input', () => {
downloadBtn.addEventListener('click', () => {
downloadData();
});
main
// 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';
});



const fileInput = document.getElementById('file-input');
const dropZone = document.getElementById('drop-zone');
Expand Down Expand Up @@ -1387,4 +1409,5 @@ if (calendarDownloadBtn) {
calendarDownloadBtn.addEventListener('click', () => {
downloadCalendar();
});
}
}
main