Skip to content
Snippets Groups Projects
Commit 16680c58 authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Improved check for valid dates

parent 83ebd8fd
No related branches found
No related tags found
No related merge requests found
Pipeline #57095 failed
......@@ -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"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment