Skip to content

Commit 1a04299

Browse files
committed
Fix bug with it being 0:00am rather than 12:00am
1 parent 386942c commit 1a04299

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/TimeView.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ var DateTimePickerTime = React.createClass({
4141
renderCounter: function( type ){
4242
if (type !== 'daypart') {
4343
var value = this.state[ type ];
44-
if (type === 'hours' && this.props.timeFormat.indexOf(' A') !== -1 && value > 12) {
45-
if (value > 12){
46-
value = value - 12;
47-
}
44+
if (type === 'hours' && this.props.timeFormat.indexOf(' A') !== -1) {
45+
value = (value - 1) % 12 + 1;
46+
4847
if (value === 0) {
4948
value = 12;
5049
}

0 commit comments

Comments
 (0)