fixup better
This commit is contained in:
parent
a975be99e9
commit
c1f672bcf6
|
|
@ -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} />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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} />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user