From e22c3814e86dbfcf6d1637ce2532f40c8bcc70dc Mon Sep 17 00:00:00 2001 From: Mike Clark Date: Mon, 9 Oct 2023 22:44:11 +0100 Subject: [PATCH] valueof - same thing but better --- packages/desktop-client/src/components/select/DateSelect.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/select/DateSelect.tsx b/packages/desktop-client/src/components/select/DateSelect.tsx index 92794462286..e3ab976d505 100644 --- a/packages/desktop-client/src/components/select/DateSelect.tsx +++ b/packages/desktop-client/src/components/select/DateSelect.tsx @@ -373,7 +373,7 @@ export default function DateSelect({ setValue(selectedValue || ''); let date = parse(selectedValue, dateFormat, new Date()); - if (date instanceof Date && !isNaN(date.getTime())) { + if (date instanceof Date && !isNaN(date.valueOf())) { onSelect(format(date, 'yyyy-MM-dd')); } }