From 16680c580a6253f8125b87d517409625958b63ab Mon Sep 17 00:00:00 2001 From: Maximilian Giller <m.giller@tu-bs.de> Date: Sat, 1 Oct 2022 00:04:24 +0200 Subject: [PATCH] Improved check for valid dates --- src/editor/components/datevisibilityinput.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/editor/components/datevisibilityinput.tsx b/src/editor/components/datevisibilityinput.tsx index 623ac5b..3406fb6 100644 --- a/src/editor/components/datevisibilityinput.tsx +++ b/src/editor/components/datevisibilityinput.tsx @@ -8,7 +8,7 @@ type DateVisibilityInputProps = { function DateVisibilityInput({ date, onDateChange }: DateVisibilityInputProps) { const isDate = (date?: string): boolean => { - if (!date) { + if (!date || date.length !== 10) { return false; } @@ -80,7 +80,6 @@ function DateVisibilityInput({ date, onDateChange }: DateVisibilityInputProps) { onChange={(e) => updateVisibilityState(e.target.checked)} /> <label htmlFor="date-checkbox">Always visible</label> - {editedDate} {!alwaysVisible && ( <input type={"date"} -- GitLab