Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix issue35 #43

Merged
merged 3 commits into from

2 participants

@ssharunas

Bug is obvious in demo/documentation page:
1. Enter 11 minutes in first picker
2. Enter 22 minutes in second picker

Expected result:
22 minutes in second picker

Actual result:
11 minutes in second picker

@jdewit jdewit merged commit b3ef388 into jdewit:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 28, 2012
  1. Fixed Issue #38 Bug with width in Google Chrome

    sarunas authored
Commits on Sep 1, 2012
  1. @ssharunas

    27:30 is accepted

    ssharunas authored
  2. @ssharunas
This page is out of date. Refresh to see the latest.
View
15 compiled/timepicker.css
@@ -1,4 +1,3 @@
-
.bootstrap-timepicker.dropdown-menu {
border-radius: 4px 4px 4px 4px;
display: none;
@@ -6,6 +5,7 @@
margin-top: 1px;
padding: 4px;
top: 0;
+ min-width: 10px;
}
.bootstrap-timepicker.dropdown-menu.open {
display: inline-block;
@@ -46,16 +46,6 @@
margin: 0;
padding: 2px;
text-align: center;
- width: 49%;
-}
-.bootstrap-timepicker table.show-meridian td, .bootstrap-timepicker table.show-seconds td {
- width: 32%;
-}
-.bootstrap-timepicker table.show-seconds.show-meridian td {
- width: 23.5%;
-}
-.bootstrap-timepicker table td.separator {
- width: 2% !important;
}
.bootstrap-timepicker table td span {
width: 100%;
@@ -66,7 +56,7 @@
margin: 0;
outline: 0 none;
padding: 8px 0;
- width: 90%;
+ width: 3em;
}
.bootstrap-timepicker table td a:hover {
background-color: #EEEEEE;
@@ -89,4 +79,3 @@
height: 16px;
width: 16px;
}
-
View
24 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,12 +335,18 @@
if (this.meridian != 'AM' && this.meridian != 'PM') {
this.meridian = 'AM';
}
+ } else {
+ if (this.hour >= 24) {
+ this.hour = 23;
+ } else if (this.hour < 0) {
+ this.hour = 0;
+ }
}
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) {
@@ -348,8 +354,8 @@
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;
}
}
@@ -485,13 +491,13 @@
}
, updateFromWidgetInputs: function () {
- var time = $('input.bootstrap-timepicker-hour').val() + ':' +
- $('input.bootstrap-timepicker-minute').val() +
+ var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
+ $('input.bootstrap-timepicker-minute', this.$widget).val() +
(this.showSeconds ?
- ':' + $('input.bootstrap-timepicker-second').val()
+ ':' + $('input.bootstrap-timepicker-second', this.$widget).val()
: '') +
(this.showMeridian ?
- ' ' + $('input.bootstrap-timepicker-meridian').val()
+ ' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val()
: '');
this.setValues(time);
View
19 less/timepicker.less
@@ -16,6 +16,7 @@
-moz-border-radius: 4px;
border-radius: 4px;
display: none;
+ min-width: 10px;
&.open {
display: inline-block;
@@ -61,33 +62,17 @@
td {
text-align: center;
height: 30px;
- width: 49%;
margin: 0;
padding: 2px;
}
- &.show-meridian, &.show-seconds {
- td {
- width: 32%;
- }
- }
-
- &.show-seconds.show-meridian {
- td {
- width: 23.5%;
- }
- }
-
td {
- &.separator {
- width: 2% !important;
- }
span {
width: 100%;
}
a {
border: 1px transparent solid;
- width: 90%;
+ width: 3em;
display: inline-block;
margin: 0;
padding: 8px 0;
Something went wrong with that request. Please try again.