diff --git a/packages/core/helper-plugin/lib/src/components/DateTimePicker/index.js b/packages/core/helper-plugin/lib/src/components/DateTimePicker/index.js index efd7b7e083..dc68b34e50 100644 --- a/packages/core/helper-plugin/lib/src/components/DateTimePicker/index.js +++ b/packages/core/helper-plugin/lib/src/components/DateTimePicker/index.js @@ -96,11 +96,15 @@ const DateTimePicker = ({ const handleTimeClear = () => { setTimeValue(undefined); - if (dateValue && onChange) { - const dateToSet = new Date(dateValue); + let dateToSet; + + if (dateValue) { + dateToSet = new Date(dateValue); dateToSet.setHours('00'); dateToSet.setMinutes('00'); + } + if (onChange) { onChange(dateToSet); } };