diff --git a/js/bootstrap-timepicker.js b/js/bootstrap-timepicker.js index bbb923c5..fd09c060 100644 --- a/js/bootstrap-timepicker.js +++ b/js/bootstrap-timepicker.js @@ -33,6 +33,7 @@ this.icons = options.icons; this.maxHours = options.maxHours; this.explicitMode = options.explicitMode; // If true 123 = 1:23, 12345 = 1:23:45, else invalid. + this.clearText = options.clearText;//the text (if any) to show the clear button this.handleDocumentClick = function (e) { var self = e.data.scope; @@ -98,6 +99,7 @@ 'keyup.timepicker': $.proxy(self.widgetKeyup, self) }); }); + this.$widget.find('.timepicker-empty-btn').on('click', $.proxy(this.clear, this)); } this.setDefaultTime(this.defaultTime); @@ -325,7 +327,8 @@ '' : '') + ''+ - ''; + '' + + (this.clearText ? '' + this.clearText + '' : ''); switch(this.template) { case 'modal':