Skip to content

Commit

Permalink
Fix numbers being used instead of strings in internal input state
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Apr 29, 2021
1 parent 1acbaa4 commit e1c412e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DateTimeInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,22 +441,22 @@ export default class DateTimeInput extends PureComponent {
case 'hour12': {
this.setState(
(prevState) => ({
hour: value ? convert12to24(parseInt(value, 10), prevState.amPm) : null,
hour: value ? convert12to24(parseInt(value, 10), prevState.amPm).toString() : '',
}),
this.onChangeExternal,
);
break;
}
case 'hour24': {
this.setState(
{ hour: value ? parseInt(value, 10) : null },
{ hour: value },
this.onChangeExternal,
);
break;
}
default: {
this.setState(
{ [name]: value ? parseInt(value, 10) : null },
{ [name]: value },
this.onChangeExternal,
);
}
Expand Down

0 comments on commit e1c412e

Please sign in to comment.