IO-2834 Time Picker Correction
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -7,11 +7,12 @@ import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
|||||||
//To be used as a form element only.
|
//To be used as a form element only.
|
||||||
|
|
||||||
const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, ...restProps }, ref) => {
|
const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, ...restProps }, ref) => {
|
||||||
// const handleChange = (newDate) => {
|
const handleDateChange = (date) => {
|
||||||
// if (value !== newDate && onChange) {
|
const newValue = date ? dayjs(date).set('hour', dayjs().hour()).set('minute', dayjs().minute()) : null;
|
||||||
// onChange(newDate);
|
if (onChange) {
|
||||||
// }
|
onChange(newValue);
|
||||||
// };
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ width: "100%" }} id={id}>
|
<Space direction="vertical" style={{ width: "100%" }} id={id}>
|
||||||
@@ -22,7 +23,7 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, ...restProps
|
|||||||
})}
|
})}
|
||||||
value={value}
|
value={value}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
onChange={onChange}
|
onChange={handleDateChange}
|
||||||
onlyFuture={onlyFuture}
|
onlyFuture={onlyFuture}
|
||||||
isDateOnly={false}
|
isDateOnly={false}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user