IO-2834 Time Picker Correction

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2024-08-19 10:29:46 -07:00
parent 82ecb5533f
commit 8d6401018c

View File

@@ -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}
/>