fixup better

This commit is contained in:
honzapatCZ 2026-06-03 15:34:54 +02:00
parent a975be99e9
commit c1f672bcf6
2 changed files with 2 additions and 2 deletions

View File

@ -15,5 +15,5 @@ export default function DateField(props) {
return <Input type="date" return <Input type="date"
value={isValid ? parsedDate.format("YYYY-MM-DD") : ""} value={isValid ? parsedDate.format("YYYY-MM-DD") : ""}
onChange={(e)=>onChange(e.target.value ? dayjs(e.target.value).toDate() : null)} {...field} {...restProps} />; onChange={(e)=>onChange({ target: { value: e.target.value ? dayjs(e.target.value).toDate() : null, name: field.name } })} {...field} {...restProps} />;
} }

View File

@ -17,6 +17,6 @@ export default function DateTimeField(props) {
value={isValid ? parsedDate.format("YYYY-MM-DDTHH:mm") : ""} value={isValid ? parsedDate.format("YYYY-MM-DDTHH:mm") : ""}
onChange={(e)=>{ onChange={(e)=>{
const val = e.target.value; const val = e.target.value;
onChange(val ? dayjs(val).toDate() : null); onChange({ target: { value: val ? dayjs(val).toDate() : null, name: field.name } });
}} {...field} {...restProps} />; }} {...field} {...restProps} />;
} }