Skip to content

Commit

Permalink
27:30 is accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
ssharunas committed Sep 1, 2012
1 parent 50cfe99 commit 6cbb66c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions js/bootstrap-timepicker.js
Expand Up @@ -313,7 +313,7 @@
this.second = parseInt(timeArray[2], 10); this.second = parseInt(timeArray[2], 10);


if (isNaN(this.hour)) { if (isNaN(this.hour)) {
this.hour = 1; this.hour = 0;
} }
if (isNaN(this.minute)) { if (isNaN(this.minute)) {
this.minute = 0; this.minute = 0;
Expand All @@ -335,21 +335,25 @@
if (this.meridian != 'AM' && this.meridian != 'PM') { if (this.meridian != 'AM' && this.meridian != 'PM') {
this.meridian = 'AM'; this.meridian = 'AM';
} }
} else {
if (this.hour >= 24) {
this.hour = 23;
}
} }


if (this.minute < 0) { if (this.minute < 0) {
this.minute = 0; this.minute = 0;
} else if (this.minute > 60) { } else if (this.minute >= 60) {
this.minute = 60; this.minute = 59;
} }


if (this.showSeconds) { if (this.showSeconds) {
if (isNaN(this.second)) { if (isNaN(this.second)) {
this.second = 0; this.second = 0;
} else if (this.second < 0) { } else if (this.second < 0) {
this.second = 0; this.second = 0;
} else if (this.second > 60) { } else if (this.second >= 60) {
this.second = 60; this.second = 59;
} }
} }


Expand Down

0 comments on commit 6cbb66c

Please sign in to comment.