From dec7411f30d1f9058cd211e0d9fb79aebb935f73 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 1 Jul 2015 13:47:23 +0200 Subject: [PATCH] timepicker: automatically activate am/pm when the element contains class time--12 --- .../javascripts/app/lib/bootstrap/bootstrap-timepicker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/javascripts/app/lib/bootstrap/bootstrap-timepicker.js b/app/assets/javascripts/app/lib/bootstrap/bootstrap-timepicker.js index 0d73589f0..d612254d9 100644 --- a/app/assets/javascripts/app/lib/bootstrap/bootstrap-timepicker.js +++ b/app/assets/javascripts/app/lib/bootstrap/bootstrap-timepicker.js @@ -11,6 +11,7 @@ * - maxHours * - automatically jump from hours to minutes when typing in a number * - continue stepping from manually input value + * - activate meridian on class 'time--12' * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -47,6 +48,10 @@ _init: function() { var self = this; + if (this.$element.hasClass('time--12')) { + this.showMeridian = true + } + if (this.showWidgetOnAddonClick && (this.$element.parent().hasClass('input-append') || this.$element.parent().hasClass('input-prepend'))) { this.$element.parent('.input-append, .input-prepend').find('.add-on').on({ 'click.timepicker': $.proxy(this.showWidget, this)