Skip to content

Commit e1c412e

Browse files
committed
Fix numbers being used instead of strings in internal input state
1 parent 1acbaa4 commit e1c412e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DateTimeInput.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,22 +441,22 @@ export default class DateTimeInput extends PureComponent {
441441
case 'hour12': {
442442
this.setState(
443443
(prevState) => ({
444-
hour: value ? convert12to24(parseInt(value, 10), prevState.amPm) : null,
444+
hour: value ? convert12to24(parseInt(value, 10), prevState.amPm).toString() : '',
445445
}),
446446
this.onChangeExternal,
447447
);
448448
break;
449449
}
450450
case 'hour24': {
451451
this.setState(
452-
{ hour: value ? parseInt(value, 10) : null },
452+
{ hour: value },
453453
this.onChangeExternal,
454454
);
455455
break;
456456
}
457457
default: {
458458
this.setState(
459-
{ [name]: value ? parseInt(value, 10) : null },
459+
{ [name]: value },
460460
this.onChangeExternal,
461461
);
462462
}

0 commit comments

Comments
 (0)