Skip to content
Browse files

27:30 is accepted

  • Loading branch information...
1 parent 50cfe99 commit 6cbb66c2c94ec85a1aff372fb30fadd268eb1012 @ssharunas committed Sep 1, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 js/bootstrap-timepicker.js
View
14 js/bootstrap-timepicker.js
@@ -313,7 +313,7 @@
this.second = parseInt(timeArray[2], 10);
if (isNaN(this.hour)) {
- this.hour = 1;
+ this.hour = 0;
}
if (isNaN(this.minute)) {
this.minute = 0;
@@ -335,21 +335,25 @@
if (this.meridian != 'AM' && this.meridian != 'PM') {
this.meridian = 'AM';
}
+ } else {
+ if (this.hour >= 24) {
+ this.hour = 23;
+ }
}
if (this.minute < 0) {
this.minute = 0;
- } else if (this.minute > 60) {
- this.minute = 60;
+ } else if (this.minute >= 60) {
+ this.minute = 59;
}
if (this.showSeconds) {
if (isNaN(this.second)) {
this.second = 0;
} else if (this.second < 0) {
this.second = 0;
- } else if (this.second > 60) {
- this.second = 60;
+ } else if (this.second >= 60) {
+ this.second = 59;
}
}

0 comments on commit 6cbb66c

Please sign in to comment.
Something went wrong with that request. Please try again.