Skip to content

Commit 046e1aa

Browse files
committed
make onTimeUpdate code follow what onDateUpdate does
1 parent b258d12 commit 046e1aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/widgets/DateTimePicker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ export default class DateTimePicker extends Component {
140140
});
141141
}
142142

143-
onTimeUpdate() {
143+
onTimeUpdate(value) {
144144
const {time: currentTime, date: currentDate} = this.parseDateTime(this.props.value);
145-
const isValidTime = isDateTime(testDate + ' ' + this.state.timeValue);
145+
const isValidTime = isDateTime(testDate + ' ' + value);
146146

147-
if (this.state.timeValue === '') {
147+
if (value === '') {
148148
this.setState({
149149
timeInputClassName: 'datetimepicker-container-time-input',
150150
timeValue: currentTime,
@@ -153,7 +153,7 @@ export default class DateTimePicker extends Component {
153153
}
154154

155155
if (isValidTime) {
156-
this.props.onChange(currentDate + ' ' + this.state.timeValue);
156+
this.props.onChange(currentDate + ' ' + value);
157157
}
158158
}
159159

0 commit comments

Comments
 (0)