From 3e9e6875376b976ab2394e11df8cd83c0c7a80fa Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 21 Sep 2023 13:04:41 -0500 Subject: [PATCH] Linted code and updated null check logic --- .../CalendarForm/validation/validateExceptions.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/forms/CalendarForm/validation/validateExceptions.tsx b/src/forms/CalendarForm/validation/validateExceptions.tsx index fc5c0cd2..ae121096 100644 --- a/src/forms/CalendarForm/validation/validateExceptions.tsx +++ b/src/forms/CalendarForm/validation/validateExceptions.tsx @@ -249,17 +249,12 @@ export function validateExceptionInterOverlaps( rows.map((row) => ({ i: row.i, startDate: dayjs - .min( - row.rows - .map(({ startDate }) => dayjs(startDate)) - .filter((date) => date.isValid()) - ) + .min(row.rows.map(({ startDate }) => dayjs(startDate)) + .filter((date) => date !== null)) .startOf('day'), endDate: dayjs - .max( - row.rows.map(({ endDate }) => dayjs(endDate)) - .filter((date) => date.isValid()) - ) + .max(row.rows.map(({ endDate }) => dayjs(endDate)) + .filter((date) => date !== null)) .endOf('day') }));