Skip to content

Commit

Permalink
Merged data- attributes with options, so setting data-minute-step="5"…
Browse files Browse the repository at this point in the history
… will set options.minuteStep to 5
  • Loading branch information
koenpunt committed May 8, 2012
1 parent 173bdb9 commit d2cddca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/bootstrap-timepicker.js
Expand Up @@ -29,7 +29,7 @@
* ================================== */
var Timepicker = function(element, options) {
this.$element = $(element);
this.options = $.extend({}, $.fn.timepicker.defaults, options);
this.options = $.extend({}, $.fn.timepicker.defaults, options, this.$element.data());
this.minuteStep = this.options.minuteStep || this.minuteStep;
this.showMeridian = this.options.showMeridian || this.showMeridian;
this.disableFocus = this.options.disableFocus || this.disableFocus;
Expand Down Expand Up @@ -211,20 +211,20 @@
}

, incrementHour: function() {
if ( this.showMeridian ){
if ( this.showMeridian ) {
if ( this.hour === 12 ) {
this.hour = 1;
return this.toggleMeridian();
}
}
if ( this.hour === 23 ){
if ( this.hour === 23 ) {
return this.hour = 0;
}
this.hour = this.hour + 1;
}

, decrementHour: function() {
if ( this.showMeridian ){
if ( this.showMeridian ) {
if (this.hour === 1) {
this.hour = 12;
return this.toggleMeridian();
Expand Down

0 comments on commit d2cddca

Please sign in to comment.