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.
|
||||
|
||||
const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, ...restProps }, ref) => {
|
||||
// const handleChange = (newDate) => {
|
||||
// if (value !== newDate && onChange) {
|
||||
// onChange(newDate);
|
||||
// }
|
||||
// };
|
||||
const handleDateChange = (date) => {
|
||||
const newValue = date ? dayjs(date).set('hour', dayjs().hour()).set('minute', dayjs().minute()) : null;
|
||||
if (onChange) {
|
||||
onChange(newValue);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: "100%" }} id={id}>
|
||||
@@ -22,7 +23,7 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, ...restProps
|
||||
})}
|
||||
value={value}
|
||||
onBlur={onBlur}
|
||||
onChange={onChange}
|
||||
onChange={handleDateChange}
|
||||
onlyFuture={onlyFuture}
|
||||
isDateOnly={false}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user