+
}
- validated={valid}
- >
+
))}
+ {valid === 'error' && (
+
+
+ }>
+ {form.errors[field.name]}
+
+
+
+ )}
);
};
@@ -96,25 +102,26 @@ const pickerWithHandlers = ComponentType => {
const Component = ComponentType === 'date' ? DatePicker : TimePicker;
return (
- }
- validated={valid}
- >
+
{
- // datepicker: onChange (event: React.FormEvent, value: string, date?: Date) => void
- // timepicker: onChange (time: string, hour?: number, minute?: number, seconds?: number, isValid?: boolean ) => void
- ComponentType === 'date' ? onChange(b, a) : onChange(a);
+ onChange={(e, value) => {
+ onChange(value);
}}
onBlur={onBlur}
{...rest}
validated={valid}
isDisabled={form.isSubmitting}
/>
+ {valid === 'error' && (
+
+
+ }>
+ {form.errors[field.name]}
+
+
+
+ )}
);
};