diff --git a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx index 23af7008a..49abaaad6 100644 --- a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx +++ b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx @@ -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 ( @@ -22,7 +23,7 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, ...restProps })} value={value} onBlur={onBlur} - onChange={onChange} + onChange={handleDateChange} onlyFuture={onlyFuture} isDateOnly={false} />