diff --git a/src/DateInput/DayInput.jsx b/src/DateInput/DayInput.jsx index 45f1e512e..9225ccd69 100644 --- a/src/DateInput/DayInput.jsx +++ b/src/DateInput/DayInput.jsx @@ -44,18 +44,16 @@ export default class DayInput extends PureComponent { const { className, disabled, itemRef, value, onChange, onKeyDown, required, showLeadingZeros, } = this.props; - + let v = parseInt(value, 10) ? parseInt(value, 10).toString().slice(-2) : ''; + if (showLeadingZeros && v.length === 1) v = '0' + v; const name = 'day'; - const hasLeadingZero = showLeadingZeros && value !== null && value < 10; - + return [ - (hasLeadingZero && 0), , ]; }