From 244626fed0d1a4f4535630195b2f3ea7d0abe24c Mon Sep 17 00:00:00 2001 From: Shabuuu-1234 Date: Tue, 19 May 2026 14:27:37 +0530 Subject: [PATCH] fix(tasks): allow editing overdue tasks without changing due date Updated the form validation to bypass the past-date check if the user is editing an existing task and keeping the original due date. This prevents users from being blocked from fixing typos on overdue tasks. --- frontend/src/components/Task/TaskFormModal.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Task/TaskFormModal.jsx b/frontend/src/components/Task/TaskFormModal.jsx index 9e6fa7d2..2bd77e9c 100644 --- a/frontend/src/components/Task/TaskFormModal.jsx +++ b/frontend/src/components/Task/TaskFormModal.jsx @@ -40,7 +40,8 @@ export default function TaskFormModal({ task, onClose, onSubmit, errorMessage, o if (!priority) return onError?.("Priority is required"); if (!dueDate) return onError?.("Due date is required"); - if (dueDate < todayStr) { + const isOriginalDate = task && dueDate === task.dueDate.split("T")[0]; + if (!isOriginalDate && dueDate < todayStr) { return alert("Due date cannot be in the past"); }