From 862bd84acc5c00253f06b3eb28fb503dff46f311 Mon Sep 17 00:00:00 2001 From: Shiva Gupta Date: Sun, 7 Dec 2025 20:36:47 +0530 Subject: [PATCH] fix(tasks): resolve black screen when editing wait date field Replaced unsafe `new Date()` with safe date parsing in wait date DatePicker. Added error handling and validation to prevent RangeError crashes. Fixes black screen bug caused by invalid date parsing. Fixes: #252 --- .../components/HomeComponents/Tasks/Tasks.tsx | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/HomeComponents/Tasks/Tasks.tsx b/frontend/src/components/HomeComponents/Tasks/Tasks.tsx index 0657d807..e482644f 100644 --- a/frontend/src/components/HomeComponents/Tasks/Tasks.tsx +++ b/frontend/src/components/HomeComponents/Tasks/Tasks.tsx @@ -1812,8 +1812,32 @@ export const Tasks = (
{ + try { + const dateStr = + editedWaitDate.includes( + 'T' + ) + ? editedWaitDate.split( + 'T' + )[0] + : editedWaitDate; + const parsed = + new Date( + dateStr + + 'T00:00:00' + ); + return isNaN( + parsed.getTime() + ) + ? undefined + : parsed; + } catch { + return undefined; + } + })() : undefined } onDateChange={(date) =>