Skip to content

Commit

Permalink
Fix issue #15652 (#15736)
Browse files Browse the repository at this point in the history
* Fix issue #15652

* Small enhancement to deal with empty inputs.

* Added changelog entry.
  • Loading branch information
miguelfeliciovieira authored and jorgefilipecosta committed May 20, 2019
1 parent d1cc70a commit 7320d0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Bug Fixes

- Fixed display of reset button when using RangeControl `allowReset` prop.
- Fixed minutes field of `DateTimePicker` missed '0' before single digit values.

## 7.3.0 (2019-04-16)

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/date-time/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ class TimePicker extends Component {
}

onChangeMinutes( event ) {
this.setState( { minutes: event.target.value } );
const minutes = event.target.value;
this.setState( {
minutes: ( minutes === '' ) ? '' : ( '0' + minutes ).slice( -2 ),
} );
}

renderMonth( month ) {
Expand Down

0 comments on commit 7320d0d

Please sign in to comment.