From 9deb9be1cd202b4f9c7bdb53dba8892e300a3126 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 18 Oct 2021 17:12:02 +0100 Subject: [PATCH] Remove date parsing from client date picker as it has moved to the core date picker --- .../components/app/forms/DateTimeField.svelte | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/packages/client/src/components/app/forms/DateTimeField.svelte b/packages/client/src/components/app/forms/DateTimeField.svelte index 298fff5a1c..46ccdca4f3 100644 --- a/packages/client/src/components/app/forms/DateTimeField.svelte +++ b/packages/client/src/components/app/forms/DateTimeField.svelte @@ -12,31 +12,6 @@ let fieldState let fieldApi - - const parseDate = val => { - if (!val) { - return null - } - let date - if (val instanceof Date) { - // Use real date obj if already parsed - date = val - } else if (isNaN(val)) { - // Treat as date string of some sort - date = new Date(val) - } else { - // Treat as numerical timestamp - date = new Date(parseInt(val)) - } - const time = date.getTime() - if (isNaN(time)) { - return null - } - // By rounding to the nearest second we avoid locking up in an endless - // loop in the builder, caused by potentially enriching {{ now }} to every - // millisecond. - return new Date(Math.floor(time / 1000) * 1000) - }