Skip to content

Commit

Permalink
Fixed #2130 - Calendar timepicker issue with hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jul 7, 2021
1 parent 4476d80 commit ac63d4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1555,17 +1555,18 @@ export class Calendar extends Component {

updateModel(event, value) {
if (this.props.onChange) {
const newValue = (value && value instanceof Date) ? new Date(value.getTime()) : value;
this.viewStateChanged = true;

this.props.onChange({
originalEvent: event,
value: value,
value: newValue,
stopPropagation: () => { },
preventDefault: () => { },
target: {
name: this.props.name,
id: this.props.id,
value: value
value: newValue
}
});
}
Expand Down

0 comments on commit ac63d4e

Please sign in to comment.