fix: ensure valid datetime format for task dueTime
Converted `dueTime` to a valid datetime-local format to fix display issues in the task edit modal. This resolves inconsistencies where the due time would not display correctly due to format mismatches.
This commit is contained in:
parent
1ddae1b7d3
commit
4586632c46
1 changed files with 6 additions and 1 deletions
|
@ -293,7 +293,11 @@ class Kanblendar {
|
||||||
document.getElementById('kanblendar-modalTitle').innerText = 'Edit Task';
|
document.getElementById('kanblendar-modalTitle').innerText = 'Edit Task';
|
||||||
document.getElementById('kanblendar-taskTitle').value = task.querySelector('.kanblendar-task-title').innerText;
|
document.getElementById('kanblendar-taskTitle').value = task.querySelector('.kanblendar-task-title').innerText;
|
||||||
document.getElementById('kanblendar-taskDescription').value = task.querySelector('.kanblendar-task-desc').innerText;
|
document.getElementById('kanblendar-taskDescription').value = task.querySelector('.kanblendar-task-desc').innerText;
|
||||||
document.getElementById('kanblendar-taskDueTime').value = task.dataset.dueTime || '';
|
|
||||||
|
// Convert task's dueTime to a valid datetime-local format
|
||||||
|
const dueTime = task.dataset.dueTime ? new Date(task.dataset.dueTime).toISOString().slice(0,16) : '';
|
||||||
|
document.getElementById('kanblendar-taskDueTime').value = dueTime;
|
||||||
|
|
||||||
document.getElementById('kanblendar-taskColumn').value = task.dataset.column || '';
|
document.getElementById('kanblendar-taskColumn').value = task.dataset.column || '';
|
||||||
document.getElementById('kanblendar-taskNotify').value = task.dataset.notifyBefore || '';
|
document.getElementById('kanblendar-taskNotify').value = task.dataset.notifyBefore || '';
|
||||||
this.deleteTaskBtn.style.display = 'block'; // Show delete button when editing
|
this.deleteTaskBtn.style.display = 'block'; // Show delete button when editing
|
||||||
|
@ -304,6 +308,7 @@ class Kanblendar {
|
||||||
}
|
}
|
||||||
this.taskModal.style.display = 'flex';
|
this.taskModal.style.display = 'flex';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
closeModalFunc() {
|
closeModalFunc() {
|
||||||
this.taskModal.style.display = 'none';
|
this.taskModal.style.display = 'none';
|
||||||
|
|
Loading…
Reference in a new issue