diff --git a/dist/bootstrap-clockpicker.js b/dist/bootstrap-clockpicker.js
index ff45d3e..28f9282 100644
--- a/dist/bootstrap-clockpicker.js
+++ b/dist/bootstrap-clockpicker.js
@@ -620,6 +620,8 @@
// The input can be changed by the user
// So before we can use this.hours/this.minutes we must update it
ClockPicker.prototype.parseInputValue = function(){
+ if(this.timeValue !== undefined && this.options.noInput) return;
+
var value = this.timeValue || (!this.options.noInput && this.input.prop('value')) || this.options['default'] || '';
this.timeValue = null;
diff --git a/dist/bootstrap-clockpicker.min.js b/dist/bootstrap-clockpicker.min.js
index abe4496..ec1eed6 100644
--- a/dist/bootstrap-clockpicker.min.js
+++ b/dist/bootstrap-clockpicker.min.js
@@ -3,4 +3,4 @@
* Copyright 2014 Wang Shenwei.
* Licensed under MIT (https://github.com/weareoutman/clockpicker/blob/gh-pages/LICENSE)
*/
-!function(){function t(){if(l.height()<=c.height())return 0;var t=p('
').appendTo("body"),e=t[0].offsetWidth;t.css("overflow","scroll");var i=p('
').appendTo(t),s=i[0].offsetWidth;return t.remove(),e-s}function e(t){return document.createElementNS(u,t)}function i(t){return(10>t?"0":"")+t}function s(t){var e=++w+"";return t?t+e:e}function o(t,o){function r(t,e){var i=u.offset(),s=/^touch/.test(t.type),n=i.left+y,r=i.top+y,p=(s?t.originalEvent.touches[0]:t).pageX-n,c=(s?t.originalEvent.touches[0]:t).pageY-r,l=Math.sqrt(p*p+c*c),d=!1;if(!e||!(T-P>l||l>T+P)){t.preventDefault();var k=setTimeout(function(){a.addClass("clockpicker-moving")},200);m&&u.append(D.canvas),D.setHand(p,c,!0,!0),h.off(v).on(v,function(t){t.preventDefault();var e=/^touch/.test(t.type),i=(e?t.originalEvent.touches[0]:t).pageX-n,s=(e?t.originalEvent.touches[0]:t).pageY-r;(d||i!==p||s!==c)&&(d=!0,D.setHand(i,s,!0,!0))}),h.off(g).on(g,function(t){h.off(g),t.preventDefault();var e=/^touch/.test(t.type),i=(e?t.originalEvent.changedTouches[0]:t).pageX-n,s=(e?t.originalEvent.changedTouches[0]:t).pageY-r;D.setHand(i,s,!1,!0),"hours"===D.currentView?D.toggleView("minutes",x/2):o.twelveHour&&!D.amOrPmSelected&&o.autoClose?D.toggleView("ampm",x/2):D.autoCloseIfEnabled(),u.prepend(j),clearTimeout(k),a.removeClass("clockpicker-moving"),h.off(v)})}}var c=p(H),l=c.find(".clockpicker-popover-inner"),u=c.find(".clockpicker-plate"),d=c.find(".clockpicker-hours"),k=c.find(".clockpicker-minutes"),b=c.find(".clockpicker-am-pm-block"),w=c.find(".popover-content"),A=c.find(".popover-footer"),S=c.find(".clockpicker-span-blank"),M="INPUT"===t.prop("tagName"),B=o.noInput?null:M?t:t.find("input"),I=B&&"time"===B.prop("type"),O=t.find(".input-group-addon"),D=this;this.id=s("cp"),this.element=t,this.options=o,this.options.hourStep=this.parseStep(this.options.hourStep,12),this.options.minuteStep=this.parseStep(this.options.minuteStep,60),this.isAppended=!1,this.isShown=!1,this.currentView="hours",this.isInput=M,this.isHTML5=I,this.input=B,this.addon=O,this.popover=c,this.popoverInner=l,this.popoverContent=w,this.popoverTitle=c.find(".popover-title"),this.plate=u,this.hoursView=d,this.minutesView=k,this.amPmBlock=b,this.spanHours=c.find(".clockpicker-span-hours"),this.spanMinutes=c.find(".clockpicker-span-minutes"),this.spanAmPm=c.find(".clockpicker-span-am-pm"),this.amOrPm="",this.currentPlacementClass=o.placement,c.toggleClass("clockpicker-popover-inline",o.inline),b.toggleClass("clockpicker-am-pm-block-hidden",!o.twelveHour),S.html(o.blankTitle),o.twelveHour&&(p(''+o.amText+" ").on("click",function(){var t=D.amOrPm!==o.amText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.amText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock),p(''+o.pmText+" ").on("click",function(){var t=D.amOrPm!==o.pmText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.pmText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock)),o.showNow&&p(''+o.nowText+" ").click(p.proxy(this.now,this)).appendTo(A),o.showClear&&p(''+o.clearText+" ").click(p.proxy(this.clear,this)).appendTo(A),o.showDone&&p(''+o.doneText+" ").click(p.proxy(this.done,this)).appendTo(A),!/^(top|bottom)/.test(o.placement)||"top"!==o.align&&"bottom"!==o.align||(o.align="left"),"left"!==o.placement&&"right"!==o.placement||"left"!==o.align&&"right"!==o.align||(o.align="top"),o.inline||(c.addClass(o.placement),c.addClass("clockpicker-align-"+o.align)),this.spanHours.click(p.proxy(this.toggleView,this,"hours")),this.spanMinutes.click(p.proxy(this.toggleView,this,"minutes")),o.twelveHour&&this.spanAmPm.click(p.proxy(this.toggleView,this,"ampm")),o.inline||(o.addonOnly||o.noInput||B.on("focus.clockpicker click.clockpicker",p.proxy(this.show,this)),O.on("click.clockpicker",p.proxy(this.toggle,this)));var E,L,N,z,W=p('
');if(o.twelveHour)for(E=0;12>E;E+=o.hourStep)L=W.clone(),N=E/6*Math.PI,z=T,L.css("font-size","120%"),L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),L.html(0===E?12:E),d.append(L),L.on(f,r);else for(E=0;24>E;E+=o.hourStep){L=W.clone(),N=E/6*Math.PI;var _=E>0&&13>E;z=_?C:T,L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),_&&L.css("font-size","120%"),L.html(0===E?"00":E),d.append(L),L.on(f,r)}var U=Math.max(o.minuteStep,5);for(E=0;60>E;E+=U)L=W.clone(),N=E/30*Math.PI,L.css({left:y+Math.sin(N)*T-P,top:y-Math.cos(N)*T-P}),L.css("font-size","120%"),L.html(i(E)),k.append(L),L.on(f,r);if(u.on(f,function(t){0===p(t.target).closest(".clockpicker-tick").length&&r(t,!0)}),m){var j=c.find(".clockpicker-canvas"),R=e("svg");R.setAttribute("class","clockpicker-svg"),R.setAttribute("width",V),R.setAttribute("height",V);var X=e("g");X.setAttribute("transform","translate("+y+","+y+")");var Y=e("circle");Y.setAttribute("class","clockpicker-canvas-bearing"),Y.setAttribute("cx",0),Y.setAttribute("cy",0),Y.setAttribute("r",2);var q=e("line");q.setAttribute("x1",0),q.setAttribute("y1",0);var F=e("circle");F.setAttribute("class","clockpicker-canvas-bg"),F.setAttribute("r",P);var G=e("circle");G.setAttribute("class","clockpicker-canvas-fg"),G.setAttribute("r",3.5),X.appendChild(q),X.appendChild(F),X.appendChild(G),X.appendChild(Y),R.appendChild(X),j.append(R),this.hand=q,this.bg=F,this.fg=G,this.bearing=Y,this.g=X,this.canvas=j}o.inline&&(a=this.element.append(this.popover),this.isAppended=!0,this.resetToInitialView()),n(this.options.init)}function n(t,e){t&&"function"==typeof t&&t(e)}function r(t,e,i){var s=e.outerHeight(),o=t.outerHeight(),n=t.offset().top,r=t.offset().top+o,a=n-t[0].getBoundingClientRect().top,p=a+document.documentElement.clientHeight,c=n-s>=a,h=p>=r+s;if("top"===i){if(c)return"top";if(h)return"bottom"}else{if(h)return"bottom";if(c)return"top"}return"viewport-top"}var a,p=window.jQuery,c=p(window),h=p(document),l=p(document.documentElement),u="http://www.w3.org/2000/svg",m="SVGAngle"in window&&function(){var t,e=document.createElement("div");return e.innerHTML=" ",t=(e.firstChild&&e.firstChild.namespaceURI)==u,e.innerHTML="",t}(),d=function(){var t=document.createElement("div").style;return"transition"in t||"WebkitTransition"in t||"MozTransition"in t||"msTransition"in t||"OTransition"in t}(),k="ontouchstart"in window,f="mousedown"+(k?" touchstart":""),v="mousemove.clockpicker"+(k?" touchmove.clockpicker":""),g="mouseup.clockpicker"+(k?" touchend.clockpicker":""),b=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,w=0,y=100,T=80,C=54,P=13,V=2*y,x=d?350:1,H=['','
','
','
','
',' ',' ',' : ',' ',' ',"
",'
",'","
","
","
"].join("");o.prototype.parseStep=function(t,e){return e%t===0?t:1},o.DEFAULTS={"default":"",fromNow:0,placement:"bottom",align:"left",doneText:"Done",clearText:"Clear",nowText:"Now",autoClose:!1,showClear:!1,showNow:!1,showDone:!0,twelveHour:!1,amText:"AM",pmText:"PM",vibrate:!0,hourStep:1,minuteStep:1,addonOnly:!1,setInput:!0,noInput:!1,showBlank:!1,blankTitle:"",preventScroll:!1,preventClose:!1,inline:!1,container:null,offset:null,klass:{amButton:null,pmButton:null,clearButton:null,nowButton:null,doneButton:null}},o.prototype.toggle=function(){this[this.isShown?"hide":"show"]()},o.prototype.updatePlacementClass=function(t){this.currentPlacementClass&&this.popover.removeClass(this.currentPlacementClass),t&&this.popover.addClass(t),this.currentPlacementClass=t},o.prototype.locate=function(){if(!this.options.inline){var t=this.element,e=this.popover,i=this.options.offset||t.offset(),s=t.outerWidth(),o=t.outerHeight(),n=this.options.placement,a=this.options.align,p={};if("top-adaptive"===n||"bottom-adaptive"===n){var c=n.substr(0,n.indexOf("-"));n=r(t,e,c),this.updatePlacementClass("viewport-top"!==n?n:"")}switch(this.popover.addClass("clockpicker-popover-open"),n){case"bottom":p.top=i.top+o;break;case"right":p.left=i.left+s;break;case"top":p.top=i.top-e.outerHeight();break;case"left":p.left=i.left-e.outerWidth();break;case"viewport-top":p.top=i.top-t[0].getBoundingClientRect().top}switch(a){case"left":p.left=i.left;break;case"right":p.left=i.left+s-e.outerWidth();break;case"top":p.top=i.top;break;case"bottom":p.top=i.top+o-e.outerHeight()}e.css(p)}},o.prototype.resetToInitialView=function(t){this.parseInputValue(),this.spanHours.html(this.options.showBlank&&this.hoursBlank?"__":i(this.hours)),this.spanMinutes.html(this.options.showBlank&&this.minutesBlank?"__":i(this.minutes)),this.options.twelveHour&&this.spanAmPm.empty().append(" "+this.amOrPm),this.toggleView(t?this.isDisplayingAmPmView?"ampm":this.currentView:"hours"),this.amOrPmSelected=!1},o.prototype.parseInputValue=function(){var t=this.timeValue||!this.options.noInput&&this.input.prop("value")||this.options["default"]||"";if(this.timeValue=null,"now"===t&&(t=new Date(+new Date+this.options.fromNow)),t instanceof Date&&(t=t.getHours()+":"+t.getMinutes()),t=t.split(":"),this.hours=(t[0]+"").replace(/[\D\s]/g,""),this.minutes=(t[1]+"").replace(/[\D\s]/g,""),this.hoursBlank=!this.hours,this.minutesBlank=!this.minutes,this.hours=+this.hours,this.minutes=+this.minutes,this.minutes&&(this.minutes=Math.round(this.minutes/this.options.minuteStep)*this.options.minuteStep),this.hours){this.hours=Math.round(this.hours/this.options.hourStep)*this.options.hourStep;var e=(t[1]+"").replace(/[\d\s]/g,"").toLowerCase(),i="am"===e||e===this.options.amText.toLowerCase(),s="pm"===e||e===this.options.pmText.toLowerCase();this.amOrPm=s?this.options.pmText:i?this.options.amText:"",this.options.twelveHour?(this.amOrPm||(this.amOrPm=this.hours>=12?this.options.pmText:this.options.amText),this.hours>12?this.hours-=12:0===this.hours&&(this.hours=12)):this.hours<12&&s?this.hours+=12:this.hours>=12&&i&&(this.hours-=12)}else this.amOrPm=this.options.pmText},o.prototype.show=function(){if(!this.isShown&&!this.options.inline){n(this.options.beforeShow);var e=this;this.isAppended||(a=p(this.options.container||document.body).append(this.popover),c.on("resize.clockpicker"+this.id,function(){e.isShown&&e.locate()}),this.isAppended=!0),this.resetToInitialView(),this.locate(),this.isShown=!0,this.options.preventScroll&&l.css("overflow","hidden").css("padding-right","+="+t()),this.options.preventClose||(h.on("click.clockpicker."+this.id+" focusin.clockpicker."+this.id,function(t){var i=p(t.target);0===i.closest(e.popoverInner).length&&0===i.closest(e.addon).length&&0===i.closest(e.input).length&&e.hide()}),h.on("keyup.clockpicker."+this.id,function(t){27===t.keyCode&&e.hide()})),n(this.options.afterShow)}},o.prototype.hide=function(){this.options.inline||(n(this.options.beforeHide),this.isShown=!1,this.options.preventScroll&&l.css("overflow","").css("padding-right","-="+t()),h.off("click.clockpicker."+this.id+" focusin.clockpicker."+this.id),h.off("keyup.clockpicker."+this.id),this.popover.removeClass("clockpicker-popover-open"),n(this.options.afterHide))},o.prototype.toggleView=function(t,e,i){var s=!1;"minutes"===t&&"visible"===p(this.hoursView).css("visibility")&&(n(this.options.beforeHourSelect),s=!0);var o="hours"===t,r="minutes"===t,a=!o&&!r,c=o?this.hoursView:this.minutesView,h=o?this.minutesView:this.hoursView;t=a?"minutes":t,this.currentView=t,this.isDisplayingAmPmView=a,this.spanHours.toggleClass("text-primary",o),this.spanMinutes.toggleClass("text-primary",r),this.spanAmPm.toggleClass("text-primary",a),this.popoverContent.toggleClass("clockpicker-am-pm-active",a),h.addClass("clockpicker-dial-out"),c.css("visibility","visible").removeClass("clockpicker-dial-out"),i||this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(function(){h.css("visibility","hidden")},x),s&&n(this.options.afterHourSelect)},o.prototype.resetClock=function(t){if(!this.isDisplayingAmPmView){var e=this.currentView,i=this[e],s="hours"===e,o=Math.PI/(s?6:30),n=i*o,r=s&&i>0&&13>i?C:T,a=Math.sin(n)*r,p=-Math.cos(n)*r,c=this;m&&t?(c.canvas.addClass("clockpicker-canvas-out"),setTimeout(function(){c.canvas.removeClass("clockpicker-canvas-out"),c.setHand(a,p,!1,!1)},t)):this.setHand(a,p,!1,!1)}},o.prototype.setHand=function(t,e,s,o){if(!this.isDisplayingAmPmView){var r,a,c=Math.atan2(t,-e),h="hours"===this.currentView,l=Math.sqrt(t*t+e*e),u=this.options,d=h&&(T+C)/2>l,k=d?C:T;r=h?u.hourStep/6*Math.PI:u.minuteStep/30*Math.PI,u.twelveHour&&(k=T),0>c&&(c=2*Math.PI+c),a=Math.round(c/r),c=a*r,h?(a*=u.hourStep,u.twelveHour||!d!=a>0||(a+=12),u.twelveHour&&0===a&&(a=12),24===a&&(a=0)):(a*=u.minuteStep,60===a&&(a=0)),this[this.currentView]!==a&&b&&this.options.vibrate&&(this.vibrateTimer||(navigator[b](10),this.vibrateTimer=setTimeout(p.proxy(function(){this.vibrateTimer=null},this),100)));var f=this[this.currentView];o&&f!==a&&(n(u.beforeChange,this.getTime(!0)),this[this.currentView]=a,this[this.currentView+"Blank"]=!1);var v=u.showBlank&&this[this.currentView+"Blank"];this[h?"spanHours":"spanMinutes"].html(v?"__":i(a));var g=v&&!!u.blankTitle&&this[h?"minutesBlank":"hoursBlank"];if(this.popoverTitle.toggleClass("blank",g),!m&&!v)return this[h?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var t=p(this);t.toggleClass("active",a===+t.html())}),void 0;s||!h&&a%5?(this.g.insertBefore(this.hand,this.bearing),this.g.insertBefore(this.bg,this.fg),this.bg.setAttribute("class","clockpicker-canvas-bg clockpicker-canvas-bg-trans")):(this.g.insertBefore(this.hand,this.bg),this.g.insertBefore(this.fg,this.bg),this.bg.setAttribute("class","clockpicker-canvas-bg"));var w=Math.sin(c)*k,y=-Math.cos(c)*k;this.hand.setAttribute("x2",w),this.hand.setAttribute("y2",y),this.bg.setAttribute("cx",w),this.bg.setAttribute("cy",y),this.fg.setAttribute("cx",w),this.fg.setAttribute("cy",y),this.canvas.toggle(!v),o&&f!==a&&n(u.afterChange,this.getTime(!0))}},o.prototype.getTime=function(t,e){"function"==typeof t&&(e=t,t=!1),t||this.parseInputValue();var i=this.hours;this.options.twelveHour&&(12>i&&this.amOrPm===this.options.pmText?i+=12:i>=12&&this.amOrPm===this.options.amText&&(i-=12));var s=new Date;return s.setMinutes(this.minutes),s.setHours(i),s.setSeconds(0),this.options.showBlank&&this.hoursBlank?null:e&&e.apply(this.element,s)||s},o.prototype.setTime=function(t,e){this.timeValue=t,e&&this.resetToInitialView(!0)},o.prototype.done=function(){if(n(this.options.beforeDone),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),e=this.hours,s=":"+i(this.minutes);this.isHTML5&&this.options.twelveHour&&(this.hours<12&&this.amOrPm===this.options.pmText&&(e+=12),this.hours>=12&&this.amOrPm===this.options.amText&&(e-=12)),s=i(e)+s,!this.isHTML5&&this.options.twelveHour&&(s=s+" "+this.amOrPm),this.input.prop("value",s),s!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterDone)},o.prototype.clear=function(){if(n(this.options.beforeClear),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),e=null;this.input.prop("value",e),e!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterClear)},o.prototype.now=function(){n(this.options.beforeChange,this.getTime(!0));var t=new Date;this.hours=t.getHours(),this.minutes=t.getMinutes(),this.options.twelveHour&&(this.amOrPm===this.options.amText,0===this.hours?this.hours=12:this.hours>12&&(this.amOrPm=this.options.pmText,this.hours-=12)),n(this.options.afterChange,this.getTime(!0)),this.done()},o.prototype.autoCloseIfEnabled=function(){var t=this.minutesBlank||this.hoursBlank;if(this.options.autoClose&&!t){var e=this;this.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){e.done()},x/2)}},o.prototype.remove=function(){this.element.removeData("clockpicker"),this.input&&this.input.off("focus.clockpicker click.clockpicker"),this.addon&&this.addon.off("click.clockpicker"),this.isShown&&this.hide(),this.isAppended&&(c.off("resize.clockpicker"+this.id),this.popover.remove())},p.fn.clockpicker=function(t){function e(){var e=p(this),s=e.data("clockpicker");if(s){if("function"==typeof s[t])return s[t].apply(s,i)}else{var n=p.extend({},o.DEFAULTS,e.data(),"object"==typeof t&&t);e.data("clockpicker",new o(e,n))}}var i=Array.prototype.slice.call(arguments,1);if(1==this.length){var s=e.apply(this[0]);return void 0!==s?s:this}return this.each(e)}}();
\ No newline at end of file
+!function(){function t(){if(l.height()<=c.height())return 0;var t=p('
').appendTo("body"),i=t[0].offsetWidth;t.css("overflow","scroll");var e=p('
').appendTo(t),s=e[0].offsetWidth;return t.remove(),i-s}function i(t){return document.createElementNS(u,t)}function e(t){return(10>t?"0":"")+t}function s(t){var i=++w+"";return t?t+i:i}function o(t,o){function r(t,i){var e=u.offset(),s=/^touch/.test(t.type),n=e.left+y,r=e.top+y,p=(s?t.originalEvent.touches[0]:t).pageX-n,c=(s?t.originalEvent.touches[0]:t).pageY-r,l=Math.sqrt(p*p+c*c),d=!1;if(!i||!(T-P>l||l>T+P)){t.preventDefault();var k=setTimeout(function(){a.addClass("clockpicker-moving")},200);m&&u.append(D.canvas),D.setHand(p,c,!0,!0),h.off(v).on(v,function(t){t.preventDefault();var i=/^touch/.test(t.type),e=(i?t.originalEvent.touches[0]:t).pageX-n,s=(i?t.originalEvent.touches[0]:t).pageY-r;(d||e!==p||s!==c)&&(d=!0,D.setHand(e,s,!0,!0))}),h.off(g).on(g,function(t){h.off(g),t.preventDefault();var i=/^touch/.test(t.type),e=(i?t.originalEvent.changedTouches[0]:t).pageX-n,s=(i?t.originalEvent.changedTouches[0]:t).pageY-r;D.setHand(e,s,!1,!0),"hours"===D.currentView?D.toggleView("minutes",x/2):o.twelveHour&&!D.amOrPmSelected&&o.autoClose?D.toggleView("ampm",x/2):D.autoCloseIfEnabled(),u.prepend(j),clearTimeout(k),a.removeClass("clockpicker-moving"),h.off(v)})}}var c=p(H),l=c.find(".clockpicker-popover-inner"),u=c.find(".clockpicker-plate"),d=c.find(".clockpicker-hours"),k=c.find(".clockpicker-minutes"),b=c.find(".clockpicker-am-pm-block"),w=c.find(".popover-content"),A=c.find(".popover-footer"),S=c.find(".clockpicker-span-blank"),M="INPUT"===t.prop("tagName"),B=o.noInput?null:M?t:t.find("input"),I=B&&"time"===B.prop("type"),O=t.find(".input-group-addon"),D=this;this.id=s("cp"),this.element=t,this.options=o,this.options.hourStep=this.parseStep(this.options.hourStep,12),this.options.minuteStep=this.parseStep(this.options.minuteStep,60),this.isAppended=!1,this.isShown=!1,this.currentView="hours",this.isInput=M,this.isHTML5=I,this.input=B,this.addon=O,this.popover=c,this.popoverInner=l,this.popoverContent=w,this.popoverTitle=c.find(".popover-title"),this.plate=u,this.hoursView=d,this.minutesView=k,this.amPmBlock=b,this.spanHours=c.find(".clockpicker-span-hours"),this.spanMinutes=c.find(".clockpicker-span-minutes"),this.spanAmPm=c.find(".clockpicker-span-am-pm"),this.amOrPm="",this.currentPlacementClass=o.placement,c.toggleClass("clockpicker-popover-inline",o.inline),b.toggleClass("clockpicker-am-pm-block-hidden",!o.twelveHour),S.html(o.blankTitle),o.twelveHour&&(p(''+o.amText+" ").on("click",function(){var t=D.amOrPm!==o.amText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.amText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock),p(''+o.pmText+" ").on("click",function(){var t=D.amOrPm!==o.pmText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.pmText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock)),o.showNow&&p(''+o.nowText+" ").click(p.proxy(this.now,this)).appendTo(A),o.showClear&&p(''+o.clearText+" ").click(p.proxy(this.clear,this)).appendTo(A),o.showDone&&p(''+o.doneText+" ").click(p.proxy(this.done,this)).appendTo(A),!/^(top|bottom)/.test(o.placement)||"top"!==o.align&&"bottom"!==o.align||(o.align="left"),"left"!==o.placement&&"right"!==o.placement||"left"!==o.align&&"right"!==o.align||(o.align="top"),o.inline||(c.addClass(o.placement),c.addClass("clockpicker-align-"+o.align)),this.spanHours.click(p.proxy(this.toggleView,this,"hours")),this.spanMinutes.click(p.proxy(this.toggleView,this,"minutes")),o.twelveHour&&this.spanAmPm.click(p.proxy(this.toggleView,this,"ampm")),o.inline||(o.addonOnly||o.noInput||B.on("focus.clockpicker click.clockpicker",p.proxy(this.show,this)),O.on("click.clockpicker",p.proxy(this.toggle,this)));var E,L,N,z,W=p('
');if(o.twelveHour)for(E=0;12>E;E+=o.hourStep)L=W.clone(),N=E/6*Math.PI,z=T,L.css("font-size","120%"),L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),L.html(0===E?12:E),d.append(L),L.on(f,r);else for(E=0;24>E;E+=o.hourStep){L=W.clone(),N=E/6*Math.PI;var _=E>0&&13>E;z=_?C:T,L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),_&&L.css("font-size","120%"),L.html(0===E?"00":E),d.append(L),L.on(f,r)}var U=Math.max(o.minuteStep,5);for(E=0;60>E;E+=U)L=W.clone(),N=E/30*Math.PI,L.css({left:y+Math.sin(N)*T-P,top:y-Math.cos(N)*T-P}),L.css("font-size","120%"),L.html(e(E)),k.append(L),L.on(f,r);if(u.on(f,function(t){0===p(t.target).closest(".clockpicker-tick").length&&r(t,!0)}),m){var j=c.find(".clockpicker-canvas"),R=i("svg");R.setAttribute("class","clockpicker-svg"),R.setAttribute("width",V),R.setAttribute("height",V);var X=i("g");X.setAttribute("transform","translate("+y+","+y+")");var Y=i("circle");Y.setAttribute("class","clockpicker-canvas-bearing"),Y.setAttribute("cx",0),Y.setAttribute("cy",0),Y.setAttribute("r",2);var q=i("line");q.setAttribute("x1",0),q.setAttribute("y1",0);var F=i("circle");F.setAttribute("class","clockpicker-canvas-bg"),F.setAttribute("r",P);var G=i("circle");G.setAttribute("class","clockpicker-canvas-fg"),G.setAttribute("r",3.5),X.appendChild(q),X.appendChild(F),X.appendChild(G),X.appendChild(Y),R.appendChild(X),j.append(R),this.hand=q,this.bg=F,this.fg=G,this.bearing=Y,this.g=X,this.canvas=j}o.inline&&(a=this.element.append(this.popover),this.isAppended=!0,this.resetToInitialView()),n(this.options.init)}function n(t,i){t&&"function"==typeof t&&t(i)}function r(t,i,e){var s=i.outerHeight(),o=t.outerHeight(),n=t.offset().top,r=t.offset().top+o,a=n-t[0].getBoundingClientRect().top,p=a+document.documentElement.clientHeight,c=n-s>=a,h=p>=r+s;if("top"===e){if(c)return"top";if(h)return"bottom"}else{if(h)return"bottom";if(c)return"top"}return"viewport-top"}var a,p=window.jQuery,c=p(window),h=p(document),l=p(document.documentElement),u="http://www.w3.org/2000/svg",m="SVGAngle"in window&&function(){var t,i=document.createElement("div");return i.innerHTML=" ",t=(i.firstChild&&i.firstChild.namespaceURI)==u,i.innerHTML="",t}(),d=function(){var t=document.createElement("div").style;return"transition"in t||"WebkitTransition"in t||"MozTransition"in t||"msTransition"in t||"OTransition"in t}(),k="ontouchstart"in window,f="mousedown"+(k?" touchstart":""),v="mousemove.clockpicker"+(k?" touchmove.clockpicker":""),g="mouseup.clockpicker"+(k?" touchend.clockpicker":""),b=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,w=0,y=100,T=80,C=54,P=13,V=2*y,x=d?350:1,H=['','
','
','
','
',' ',' ',' : ',' ',' ',"
",'
",'","
","
","
"].join("");o.prototype.parseStep=function(t,i){return i%t===0?t:1},o.DEFAULTS={"default":"",fromNow:0,placement:"bottom",align:"left",doneText:"Done",clearText:"Clear",nowText:"Now",autoClose:!1,showClear:!1,showNow:!1,showDone:!0,twelveHour:!1,amText:"AM",pmText:"PM",vibrate:!0,hourStep:1,minuteStep:1,addonOnly:!1,setInput:!0,noInput:!1,showBlank:!1,blankTitle:"",preventScroll:!1,preventClose:!1,inline:!1,container:null,offset:null,klass:{amButton:null,pmButton:null,clearButton:null,nowButton:null,doneButton:null}},o.prototype.toggle=function(){this[this.isShown?"hide":"show"]()},o.prototype.updatePlacementClass=function(t){this.currentPlacementClass&&this.popover.removeClass(this.currentPlacementClass),t&&this.popover.addClass(t),this.currentPlacementClass=t},o.prototype.locate=function(){if(!this.options.inline){var t=this.element,i=this.popover,e=this.options.offset||t.offset(),s=t.outerWidth(),o=t.outerHeight(),n=this.options.placement,a=this.options.align,p={};if("top-adaptive"===n||"bottom-adaptive"===n){var c=n.substr(0,n.indexOf("-"));n=r(t,i,c),this.updatePlacementClass("viewport-top"!==n?n:"")}switch(this.popover.addClass("clockpicker-popover-open"),n){case"bottom":p.top=e.top+o;break;case"right":p.left=e.left+s;break;case"top":p.top=e.top-i.outerHeight();break;case"left":p.left=e.left-i.outerWidth();break;case"viewport-top":p.top=e.top-t[0].getBoundingClientRect().top}switch(a){case"left":p.left=e.left;break;case"right":p.left=e.left+s-i.outerWidth();break;case"top":p.top=e.top;break;case"bottom":p.top=e.top+o-i.outerHeight()}i.css(p)}},o.prototype.resetToInitialView=function(t){this.parseInputValue(),this.spanHours.html(this.options.showBlank&&this.hoursBlank?"__":e(this.hours)),this.spanMinutes.html(this.options.showBlank&&this.minutesBlank?"__":e(this.minutes)),this.options.twelveHour&&this.spanAmPm.empty().append(" "+this.amOrPm),this.toggleView(t?this.isDisplayingAmPmView?"ampm":this.currentView:"hours"),this.amOrPmSelected=!1},o.prototype.parseInputValue=function(){if(void 0===this.timeValue||!this.options.noInput){var t=this.timeValue||!this.options.noInput&&this.input.prop("value")||this.options["default"]||"";if(this.timeValue=null,"now"===t&&(t=new Date(+new Date+this.options.fromNow)),t instanceof Date&&(t=t.getHours()+":"+t.getMinutes()),t=t.split(":"),this.hours=(t[0]+"").replace(/[\D\s]/g,""),this.minutes=(t[1]+"").replace(/[\D\s]/g,""),this.hoursBlank=!this.hours,this.minutesBlank=!this.minutes,this.hours=+this.hours,this.minutes=+this.minutes,this.minutes&&(this.minutes=Math.round(this.minutes/this.options.minuteStep)*this.options.minuteStep),this.hours){this.hours=Math.round(this.hours/this.options.hourStep)*this.options.hourStep;var i=(t[1]+"").replace(/[\d\s]/g,"").toLowerCase(),e="am"===i||i===this.options.amText.toLowerCase(),s="pm"===i||i===this.options.pmText.toLowerCase();this.amOrPm=s?this.options.pmText:e?this.options.amText:"",this.options.twelveHour?(this.amOrPm||(this.amOrPm=this.hours>=12?this.options.pmText:this.options.amText),this.hours>12?this.hours-=12:0===this.hours&&(this.hours=12)):this.hours<12&&s?this.hours+=12:this.hours>=12&&e&&(this.hours-=12)}else this.amOrPm=this.options.pmText}},o.prototype.show=function(){if(!this.isShown&&!this.options.inline){n(this.options.beforeShow);var i=this;this.isAppended||(a=p(this.options.container||document.body).append(this.popover),c.on("resize.clockpicker"+this.id,function(){i.isShown&&i.locate()}),this.isAppended=!0),this.resetToInitialView(),this.locate(),this.isShown=!0,this.options.preventScroll&&l.css("overflow","hidden").css("padding-right","+="+t()),this.options.preventClose||(h.on("click.clockpicker."+this.id+" focusin.clockpicker."+this.id,function(t){var e=p(t.target);0===e.closest(i.popoverInner).length&&0===e.closest(i.addon).length&&0===e.closest(i.input).length&&i.hide()}),h.on("keyup.clockpicker."+this.id,function(t){27===t.keyCode&&i.hide()})),n(this.options.afterShow)}},o.prototype.hide=function(){this.options.inline||(n(this.options.beforeHide),this.isShown=!1,this.options.preventScroll&&l.css("overflow","").css("padding-right","-="+t()),h.off("click.clockpicker."+this.id+" focusin.clockpicker."+this.id),h.off("keyup.clockpicker."+this.id),this.popover.removeClass("clockpicker-popover-open"),n(this.options.afterHide))},o.prototype.toggleView=function(t,i,e){var s=!1;"minutes"===t&&"visible"===p(this.hoursView).css("visibility")&&(n(this.options.beforeHourSelect),s=!0);var o="hours"===t,r="minutes"===t,a=!o&&!r,c=o?this.hoursView:this.minutesView,h=o?this.minutesView:this.hoursView;t=a?"minutes":t,this.currentView=t,this.isDisplayingAmPmView=a,this.spanHours.toggleClass("text-primary",o),this.spanMinutes.toggleClass("text-primary",r),this.spanAmPm.toggleClass("text-primary",a),this.popoverContent.toggleClass("clockpicker-am-pm-active",a),h.addClass("clockpicker-dial-out"),c.css("visibility","visible").removeClass("clockpicker-dial-out"),e||this.resetClock(i),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(function(){h.css("visibility","hidden")},x),s&&n(this.options.afterHourSelect)},o.prototype.resetClock=function(t){if(!this.isDisplayingAmPmView){var i=this.currentView,e=this[i],s="hours"===i,o=Math.PI/(s?6:30),n=e*o,r=s&&e>0&&13>e?C:T,a=Math.sin(n)*r,p=-Math.cos(n)*r,c=this;m&&t?(c.canvas.addClass("clockpicker-canvas-out"),setTimeout(function(){c.canvas.removeClass("clockpicker-canvas-out"),c.setHand(a,p,!1,!1)},t)):this.setHand(a,p,!1,!1)}},o.prototype.setHand=function(t,i,s,o){if(!this.isDisplayingAmPmView){var r,a,c=Math.atan2(t,-i),h="hours"===this.currentView,l=Math.sqrt(t*t+i*i),u=this.options,d=h&&(T+C)/2>l,k=d?C:T;r=h?u.hourStep/6*Math.PI:u.minuteStep/30*Math.PI,u.twelveHour&&(k=T),0>c&&(c=2*Math.PI+c),a=Math.round(c/r),c=a*r,h?(a*=u.hourStep,u.twelveHour||!d!=a>0||(a+=12),u.twelveHour&&0===a&&(a=12),24===a&&(a=0)):(a*=u.minuteStep,60===a&&(a=0)),this[this.currentView]!==a&&b&&this.options.vibrate&&(this.vibrateTimer||(navigator[b](10),this.vibrateTimer=setTimeout(p.proxy(function(){this.vibrateTimer=null},this),100)));var f=this[this.currentView];o&&f!==a&&(n(u.beforeChange,this.getTime(!0)),this[this.currentView]=a,this[this.currentView+"Blank"]=!1);var v=u.showBlank&&this[this.currentView+"Blank"];this[h?"spanHours":"spanMinutes"].html(v?"__":e(a));var g=v&&!!u.blankTitle&&this[h?"minutesBlank":"hoursBlank"];if(this.popoverTitle.toggleClass("blank",g),!m&&!v)return this[h?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var t=p(this);t.toggleClass("active",a===+t.html())}),void 0;s||!h&&a%5?(this.g.insertBefore(this.hand,this.bearing),this.g.insertBefore(this.bg,this.fg),this.bg.setAttribute("class","clockpicker-canvas-bg clockpicker-canvas-bg-trans")):(this.g.insertBefore(this.hand,this.bg),this.g.insertBefore(this.fg,this.bg),this.bg.setAttribute("class","clockpicker-canvas-bg"));var w=Math.sin(c)*k,y=-Math.cos(c)*k;this.hand.setAttribute("x2",w),this.hand.setAttribute("y2",y),this.bg.setAttribute("cx",w),this.bg.setAttribute("cy",y),this.fg.setAttribute("cx",w),this.fg.setAttribute("cy",y),this.canvas.toggle(!v),o&&f!==a&&n(u.afterChange,this.getTime(!0))}},o.prototype.getTime=function(t,i){"function"==typeof t&&(i=t,t=!1),t||this.parseInputValue();var e=this.hours;this.options.twelveHour&&(12>e&&this.amOrPm===this.options.pmText?e+=12:e>=12&&this.amOrPm===this.options.amText&&(e-=12));var s=new Date;return s.setMinutes(this.minutes),s.setHours(e),s.setSeconds(0),this.options.showBlank&&this.hoursBlank?null:i&&i.apply(this.element,s)||s},o.prototype.setTime=function(t,i){this.timeValue=t,i&&this.resetToInitialView(!0)},o.prototype.done=function(){if(n(this.options.beforeDone),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),i=this.hours,s=":"+e(this.minutes);this.isHTML5&&this.options.twelveHour&&(this.hours<12&&this.amOrPm===this.options.pmText&&(i+=12),this.hours>=12&&this.amOrPm===this.options.amText&&(i-=12)),s=e(i)+s,!this.isHTML5&&this.options.twelveHour&&(s=s+" "+this.amOrPm),this.input.prop("value",s),s!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterDone)},o.prototype.clear=function(){if(n(this.options.beforeClear),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),i=null;this.input.prop("value",i),i!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterClear)},o.prototype.now=function(){n(this.options.beforeChange,this.getTime(!0));var t=new Date;this.hours=t.getHours(),this.minutes=t.getMinutes(),this.options.twelveHour&&(this.amOrPm===this.options.amText,0===this.hours?this.hours=12:this.hours>12&&(this.amOrPm=this.options.pmText,this.hours-=12)),n(this.options.afterChange,this.getTime(!0)),this.done()},o.prototype.autoCloseIfEnabled=function(){var t=this.minutesBlank||this.hoursBlank;if(this.options.autoClose&&!t){var i=this;this.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){i.done()},x/2)}},o.prototype.remove=function(){this.element.removeData("clockpicker"),this.input&&this.input.off("focus.clockpicker click.clockpicker"),this.addon&&this.addon.off("click.clockpicker"),this.isShown&&this.hide(),this.isAppended&&(c.off("resize.clockpicker"+this.id),this.popover.remove())},p.fn.clockpicker=function(t){function i(){var i=p(this),s=i.data("clockpicker");if(s){if("function"==typeof s[t])return s[t].apply(s,e)}else{var n=p.extend({},o.DEFAULTS,i.data(),"object"==typeof t&&t);i.data("clockpicker",new o(i,n))}}var e=Array.prototype.slice.call(arguments,1);if(1==this.length){var s=i.apply(this[0]);return void 0!==s?s:this}return this.each(i)}}();
\ No newline at end of file
diff --git a/dist/jquery-clockpicker.js b/dist/jquery-clockpicker.js
index ff45d3e..28f9282 100644
--- a/dist/jquery-clockpicker.js
+++ b/dist/jquery-clockpicker.js
@@ -620,6 +620,8 @@
// The input can be changed by the user
// So before we can use this.hours/this.minutes we must update it
ClockPicker.prototype.parseInputValue = function(){
+ if(this.timeValue !== undefined && this.options.noInput) return;
+
var value = this.timeValue || (!this.options.noInput && this.input.prop('value')) || this.options['default'] || '';
this.timeValue = null;
diff --git a/dist/jquery-clockpicker.min.js b/dist/jquery-clockpicker.min.js
index abe4496..ec1eed6 100644
--- a/dist/jquery-clockpicker.min.js
+++ b/dist/jquery-clockpicker.min.js
@@ -3,4 +3,4 @@
* Copyright 2014 Wang Shenwei.
* Licensed under MIT (https://github.com/weareoutman/clockpicker/blob/gh-pages/LICENSE)
*/
-!function(){function t(){if(l.height()<=c.height())return 0;var t=p('
').appendTo("body"),e=t[0].offsetWidth;t.css("overflow","scroll");var i=p('
').appendTo(t),s=i[0].offsetWidth;return t.remove(),e-s}function e(t){return document.createElementNS(u,t)}function i(t){return(10>t?"0":"")+t}function s(t){var e=++w+"";return t?t+e:e}function o(t,o){function r(t,e){var i=u.offset(),s=/^touch/.test(t.type),n=i.left+y,r=i.top+y,p=(s?t.originalEvent.touches[0]:t).pageX-n,c=(s?t.originalEvent.touches[0]:t).pageY-r,l=Math.sqrt(p*p+c*c),d=!1;if(!e||!(T-P>l||l>T+P)){t.preventDefault();var k=setTimeout(function(){a.addClass("clockpicker-moving")},200);m&&u.append(D.canvas),D.setHand(p,c,!0,!0),h.off(v).on(v,function(t){t.preventDefault();var e=/^touch/.test(t.type),i=(e?t.originalEvent.touches[0]:t).pageX-n,s=(e?t.originalEvent.touches[0]:t).pageY-r;(d||i!==p||s!==c)&&(d=!0,D.setHand(i,s,!0,!0))}),h.off(g).on(g,function(t){h.off(g),t.preventDefault();var e=/^touch/.test(t.type),i=(e?t.originalEvent.changedTouches[0]:t).pageX-n,s=(e?t.originalEvent.changedTouches[0]:t).pageY-r;D.setHand(i,s,!1,!0),"hours"===D.currentView?D.toggleView("minutes",x/2):o.twelveHour&&!D.amOrPmSelected&&o.autoClose?D.toggleView("ampm",x/2):D.autoCloseIfEnabled(),u.prepend(j),clearTimeout(k),a.removeClass("clockpicker-moving"),h.off(v)})}}var c=p(H),l=c.find(".clockpicker-popover-inner"),u=c.find(".clockpicker-plate"),d=c.find(".clockpicker-hours"),k=c.find(".clockpicker-minutes"),b=c.find(".clockpicker-am-pm-block"),w=c.find(".popover-content"),A=c.find(".popover-footer"),S=c.find(".clockpicker-span-blank"),M="INPUT"===t.prop("tagName"),B=o.noInput?null:M?t:t.find("input"),I=B&&"time"===B.prop("type"),O=t.find(".input-group-addon"),D=this;this.id=s("cp"),this.element=t,this.options=o,this.options.hourStep=this.parseStep(this.options.hourStep,12),this.options.minuteStep=this.parseStep(this.options.minuteStep,60),this.isAppended=!1,this.isShown=!1,this.currentView="hours",this.isInput=M,this.isHTML5=I,this.input=B,this.addon=O,this.popover=c,this.popoverInner=l,this.popoverContent=w,this.popoverTitle=c.find(".popover-title"),this.plate=u,this.hoursView=d,this.minutesView=k,this.amPmBlock=b,this.spanHours=c.find(".clockpicker-span-hours"),this.spanMinutes=c.find(".clockpicker-span-minutes"),this.spanAmPm=c.find(".clockpicker-span-am-pm"),this.amOrPm="",this.currentPlacementClass=o.placement,c.toggleClass("clockpicker-popover-inline",o.inline),b.toggleClass("clockpicker-am-pm-block-hidden",!o.twelveHour),S.html(o.blankTitle),o.twelveHour&&(p(''+o.amText+" ").on("click",function(){var t=D.amOrPm!==o.amText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.amText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock),p(''+o.pmText+" ").on("click",function(){var t=D.amOrPm!==o.pmText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.pmText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock)),o.showNow&&p(''+o.nowText+" ").click(p.proxy(this.now,this)).appendTo(A),o.showClear&&p(''+o.clearText+" ").click(p.proxy(this.clear,this)).appendTo(A),o.showDone&&p(''+o.doneText+" ").click(p.proxy(this.done,this)).appendTo(A),!/^(top|bottom)/.test(o.placement)||"top"!==o.align&&"bottom"!==o.align||(o.align="left"),"left"!==o.placement&&"right"!==o.placement||"left"!==o.align&&"right"!==o.align||(o.align="top"),o.inline||(c.addClass(o.placement),c.addClass("clockpicker-align-"+o.align)),this.spanHours.click(p.proxy(this.toggleView,this,"hours")),this.spanMinutes.click(p.proxy(this.toggleView,this,"minutes")),o.twelveHour&&this.spanAmPm.click(p.proxy(this.toggleView,this,"ampm")),o.inline||(o.addonOnly||o.noInput||B.on("focus.clockpicker click.clockpicker",p.proxy(this.show,this)),O.on("click.clockpicker",p.proxy(this.toggle,this)));var E,L,N,z,W=p('
');if(o.twelveHour)for(E=0;12>E;E+=o.hourStep)L=W.clone(),N=E/6*Math.PI,z=T,L.css("font-size","120%"),L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),L.html(0===E?12:E),d.append(L),L.on(f,r);else for(E=0;24>E;E+=o.hourStep){L=W.clone(),N=E/6*Math.PI;var _=E>0&&13>E;z=_?C:T,L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),_&&L.css("font-size","120%"),L.html(0===E?"00":E),d.append(L),L.on(f,r)}var U=Math.max(o.minuteStep,5);for(E=0;60>E;E+=U)L=W.clone(),N=E/30*Math.PI,L.css({left:y+Math.sin(N)*T-P,top:y-Math.cos(N)*T-P}),L.css("font-size","120%"),L.html(i(E)),k.append(L),L.on(f,r);if(u.on(f,function(t){0===p(t.target).closest(".clockpicker-tick").length&&r(t,!0)}),m){var j=c.find(".clockpicker-canvas"),R=e("svg");R.setAttribute("class","clockpicker-svg"),R.setAttribute("width",V),R.setAttribute("height",V);var X=e("g");X.setAttribute("transform","translate("+y+","+y+")");var Y=e("circle");Y.setAttribute("class","clockpicker-canvas-bearing"),Y.setAttribute("cx",0),Y.setAttribute("cy",0),Y.setAttribute("r",2);var q=e("line");q.setAttribute("x1",0),q.setAttribute("y1",0);var F=e("circle");F.setAttribute("class","clockpicker-canvas-bg"),F.setAttribute("r",P);var G=e("circle");G.setAttribute("class","clockpicker-canvas-fg"),G.setAttribute("r",3.5),X.appendChild(q),X.appendChild(F),X.appendChild(G),X.appendChild(Y),R.appendChild(X),j.append(R),this.hand=q,this.bg=F,this.fg=G,this.bearing=Y,this.g=X,this.canvas=j}o.inline&&(a=this.element.append(this.popover),this.isAppended=!0,this.resetToInitialView()),n(this.options.init)}function n(t,e){t&&"function"==typeof t&&t(e)}function r(t,e,i){var s=e.outerHeight(),o=t.outerHeight(),n=t.offset().top,r=t.offset().top+o,a=n-t[0].getBoundingClientRect().top,p=a+document.documentElement.clientHeight,c=n-s>=a,h=p>=r+s;if("top"===i){if(c)return"top";if(h)return"bottom"}else{if(h)return"bottom";if(c)return"top"}return"viewport-top"}var a,p=window.jQuery,c=p(window),h=p(document),l=p(document.documentElement),u="http://www.w3.org/2000/svg",m="SVGAngle"in window&&function(){var t,e=document.createElement("div");return e.innerHTML=" ",t=(e.firstChild&&e.firstChild.namespaceURI)==u,e.innerHTML="",t}(),d=function(){var t=document.createElement("div").style;return"transition"in t||"WebkitTransition"in t||"MozTransition"in t||"msTransition"in t||"OTransition"in t}(),k="ontouchstart"in window,f="mousedown"+(k?" touchstart":""),v="mousemove.clockpicker"+(k?" touchmove.clockpicker":""),g="mouseup.clockpicker"+(k?" touchend.clockpicker":""),b=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,w=0,y=100,T=80,C=54,P=13,V=2*y,x=d?350:1,H=['','
','
','
','
',' ',' ',' : ',' ',' ',"
",'
",'","
","
","
"].join("");o.prototype.parseStep=function(t,e){return e%t===0?t:1},o.DEFAULTS={"default":"",fromNow:0,placement:"bottom",align:"left",doneText:"Done",clearText:"Clear",nowText:"Now",autoClose:!1,showClear:!1,showNow:!1,showDone:!0,twelveHour:!1,amText:"AM",pmText:"PM",vibrate:!0,hourStep:1,minuteStep:1,addonOnly:!1,setInput:!0,noInput:!1,showBlank:!1,blankTitle:"",preventScroll:!1,preventClose:!1,inline:!1,container:null,offset:null,klass:{amButton:null,pmButton:null,clearButton:null,nowButton:null,doneButton:null}},o.prototype.toggle=function(){this[this.isShown?"hide":"show"]()},o.prototype.updatePlacementClass=function(t){this.currentPlacementClass&&this.popover.removeClass(this.currentPlacementClass),t&&this.popover.addClass(t),this.currentPlacementClass=t},o.prototype.locate=function(){if(!this.options.inline){var t=this.element,e=this.popover,i=this.options.offset||t.offset(),s=t.outerWidth(),o=t.outerHeight(),n=this.options.placement,a=this.options.align,p={};if("top-adaptive"===n||"bottom-adaptive"===n){var c=n.substr(0,n.indexOf("-"));n=r(t,e,c),this.updatePlacementClass("viewport-top"!==n?n:"")}switch(this.popover.addClass("clockpicker-popover-open"),n){case"bottom":p.top=i.top+o;break;case"right":p.left=i.left+s;break;case"top":p.top=i.top-e.outerHeight();break;case"left":p.left=i.left-e.outerWidth();break;case"viewport-top":p.top=i.top-t[0].getBoundingClientRect().top}switch(a){case"left":p.left=i.left;break;case"right":p.left=i.left+s-e.outerWidth();break;case"top":p.top=i.top;break;case"bottom":p.top=i.top+o-e.outerHeight()}e.css(p)}},o.prototype.resetToInitialView=function(t){this.parseInputValue(),this.spanHours.html(this.options.showBlank&&this.hoursBlank?"__":i(this.hours)),this.spanMinutes.html(this.options.showBlank&&this.minutesBlank?"__":i(this.minutes)),this.options.twelveHour&&this.spanAmPm.empty().append(" "+this.amOrPm),this.toggleView(t?this.isDisplayingAmPmView?"ampm":this.currentView:"hours"),this.amOrPmSelected=!1},o.prototype.parseInputValue=function(){var t=this.timeValue||!this.options.noInput&&this.input.prop("value")||this.options["default"]||"";if(this.timeValue=null,"now"===t&&(t=new Date(+new Date+this.options.fromNow)),t instanceof Date&&(t=t.getHours()+":"+t.getMinutes()),t=t.split(":"),this.hours=(t[0]+"").replace(/[\D\s]/g,""),this.minutes=(t[1]+"").replace(/[\D\s]/g,""),this.hoursBlank=!this.hours,this.minutesBlank=!this.minutes,this.hours=+this.hours,this.minutes=+this.minutes,this.minutes&&(this.minutes=Math.round(this.minutes/this.options.minuteStep)*this.options.minuteStep),this.hours){this.hours=Math.round(this.hours/this.options.hourStep)*this.options.hourStep;var e=(t[1]+"").replace(/[\d\s]/g,"").toLowerCase(),i="am"===e||e===this.options.amText.toLowerCase(),s="pm"===e||e===this.options.pmText.toLowerCase();this.amOrPm=s?this.options.pmText:i?this.options.amText:"",this.options.twelveHour?(this.amOrPm||(this.amOrPm=this.hours>=12?this.options.pmText:this.options.amText),this.hours>12?this.hours-=12:0===this.hours&&(this.hours=12)):this.hours<12&&s?this.hours+=12:this.hours>=12&&i&&(this.hours-=12)}else this.amOrPm=this.options.pmText},o.prototype.show=function(){if(!this.isShown&&!this.options.inline){n(this.options.beforeShow);var e=this;this.isAppended||(a=p(this.options.container||document.body).append(this.popover),c.on("resize.clockpicker"+this.id,function(){e.isShown&&e.locate()}),this.isAppended=!0),this.resetToInitialView(),this.locate(),this.isShown=!0,this.options.preventScroll&&l.css("overflow","hidden").css("padding-right","+="+t()),this.options.preventClose||(h.on("click.clockpicker."+this.id+" focusin.clockpicker."+this.id,function(t){var i=p(t.target);0===i.closest(e.popoverInner).length&&0===i.closest(e.addon).length&&0===i.closest(e.input).length&&e.hide()}),h.on("keyup.clockpicker."+this.id,function(t){27===t.keyCode&&e.hide()})),n(this.options.afterShow)}},o.prototype.hide=function(){this.options.inline||(n(this.options.beforeHide),this.isShown=!1,this.options.preventScroll&&l.css("overflow","").css("padding-right","-="+t()),h.off("click.clockpicker."+this.id+" focusin.clockpicker."+this.id),h.off("keyup.clockpicker."+this.id),this.popover.removeClass("clockpicker-popover-open"),n(this.options.afterHide))},o.prototype.toggleView=function(t,e,i){var s=!1;"minutes"===t&&"visible"===p(this.hoursView).css("visibility")&&(n(this.options.beforeHourSelect),s=!0);var o="hours"===t,r="minutes"===t,a=!o&&!r,c=o?this.hoursView:this.minutesView,h=o?this.minutesView:this.hoursView;t=a?"minutes":t,this.currentView=t,this.isDisplayingAmPmView=a,this.spanHours.toggleClass("text-primary",o),this.spanMinutes.toggleClass("text-primary",r),this.spanAmPm.toggleClass("text-primary",a),this.popoverContent.toggleClass("clockpicker-am-pm-active",a),h.addClass("clockpicker-dial-out"),c.css("visibility","visible").removeClass("clockpicker-dial-out"),i||this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(function(){h.css("visibility","hidden")},x),s&&n(this.options.afterHourSelect)},o.prototype.resetClock=function(t){if(!this.isDisplayingAmPmView){var e=this.currentView,i=this[e],s="hours"===e,o=Math.PI/(s?6:30),n=i*o,r=s&&i>0&&13>i?C:T,a=Math.sin(n)*r,p=-Math.cos(n)*r,c=this;m&&t?(c.canvas.addClass("clockpicker-canvas-out"),setTimeout(function(){c.canvas.removeClass("clockpicker-canvas-out"),c.setHand(a,p,!1,!1)},t)):this.setHand(a,p,!1,!1)}},o.prototype.setHand=function(t,e,s,o){if(!this.isDisplayingAmPmView){var r,a,c=Math.atan2(t,-e),h="hours"===this.currentView,l=Math.sqrt(t*t+e*e),u=this.options,d=h&&(T+C)/2>l,k=d?C:T;r=h?u.hourStep/6*Math.PI:u.minuteStep/30*Math.PI,u.twelveHour&&(k=T),0>c&&(c=2*Math.PI+c),a=Math.round(c/r),c=a*r,h?(a*=u.hourStep,u.twelveHour||!d!=a>0||(a+=12),u.twelveHour&&0===a&&(a=12),24===a&&(a=0)):(a*=u.minuteStep,60===a&&(a=0)),this[this.currentView]!==a&&b&&this.options.vibrate&&(this.vibrateTimer||(navigator[b](10),this.vibrateTimer=setTimeout(p.proxy(function(){this.vibrateTimer=null},this),100)));var f=this[this.currentView];o&&f!==a&&(n(u.beforeChange,this.getTime(!0)),this[this.currentView]=a,this[this.currentView+"Blank"]=!1);var v=u.showBlank&&this[this.currentView+"Blank"];this[h?"spanHours":"spanMinutes"].html(v?"__":i(a));var g=v&&!!u.blankTitle&&this[h?"minutesBlank":"hoursBlank"];if(this.popoverTitle.toggleClass("blank",g),!m&&!v)return this[h?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var t=p(this);t.toggleClass("active",a===+t.html())}),void 0;s||!h&&a%5?(this.g.insertBefore(this.hand,this.bearing),this.g.insertBefore(this.bg,this.fg),this.bg.setAttribute("class","clockpicker-canvas-bg clockpicker-canvas-bg-trans")):(this.g.insertBefore(this.hand,this.bg),this.g.insertBefore(this.fg,this.bg),this.bg.setAttribute("class","clockpicker-canvas-bg"));var w=Math.sin(c)*k,y=-Math.cos(c)*k;this.hand.setAttribute("x2",w),this.hand.setAttribute("y2",y),this.bg.setAttribute("cx",w),this.bg.setAttribute("cy",y),this.fg.setAttribute("cx",w),this.fg.setAttribute("cy",y),this.canvas.toggle(!v),o&&f!==a&&n(u.afterChange,this.getTime(!0))}},o.prototype.getTime=function(t,e){"function"==typeof t&&(e=t,t=!1),t||this.parseInputValue();var i=this.hours;this.options.twelveHour&&(12>i&&this.amOrPm===this.options.pmText?i+=12:i>=12&&this.amOrPm===this.options.amText&&(i-=12));var s=new Date;return s.setMinutes(this.minutes),s.setHours(i),s.setSeconds(0),this.options.showBlank&&this.hoursBlank?null:e&&e.apply(this.element,s)||s},o.prototype.setTime=function(t,e){this.timeValue=t,e&&this.resetToInitialView(!0)},o.prototype.done=function(){if(n(this.options.beforeDone),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),e=this.hours,s=":"+i(this.minutes);this.isHTML5&&this.options.twelveHour&&(this.hours<12&&this.amOrPm===this.options.pmText&&(e+=12),this.hours>=12&&this.amOrPm===this.options.amText&&(e-=12)),s=i(e)+s,!this.isHTML5&&this.options.twelveHour&&(s=s+" "+this.amOrPm),this.input.prop("value",s),s!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterDone)},o.prototype.clear=function(){if(n(this.options.beforeClear),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),e=null;this.input.prop("value",e),e!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterClear)},o.prototype.now=function(){n(this.options.beforeChange,this.getTime(!0));var t=new Date;this.hours=t.getHours(),this.minutes=t.getMinutes(),this.options.twelveHour&&(this.amOrPm===this.options.amText,0===this.hours?this.hours=12:this.hours>12&&(this.amOrPm=this.options.pmText,this.hours-=12)),n(this.options.afterChange,this.getTime(!0)),this.done()},o.prototype.autoCloseIfEnabled=function(){var t=this.minutesBlank||this.hoursBlank;if(this.options.autoClose&&!t){var e=this;this.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){e.done()},x/2)}},o.prototype.remove=function(){this.element.removeData("clockpicker"),this.input&&this.input.off("focus.clockpicker click.clockpicker"),this.addon&&this.addon.off("click.clockpicker"),this.isShown&&this.hide(),this.isAppended&&(c.off("resize.clockpicker"+this.id),this.popover.remove())},p.fn.clockpicker=function(t){function e(){var e=p(this),s=e.data("clockpicker");if(s){if("function"==typeof s[t])return s[t].apply(s,i)}else{var n=p.extend({},o.DEFAULTS,e.data(),"object"==typeof t&&t);e.data("clockpicker",new o(e,n))}}var i=Array.prototype.slice.call(arguments,1);if(1==this.length){var s=e.apply(this[0]);return void 0!==s?s:this}return this.each(e)}}();
\ No newline at end of file
+!function(){function t(){if(l.height()<=c.height())return 0;var t=p('
').appendTo("body"),i=t[0].offsetWidth;t.css("overflow","scroll");var e=p('
').appendTo(t),s=e[0].offsetWidth;return t.remove(),i-s}function i(t){return document.createElementNS(u,t)}function e(t){return(10>t?"0":"")+t}function s(t){var i=++w+"";return t?t+i:i}function o(t,o){function r(t,i){var e=u.offset(),s=/^touch/.test(t.type),n=e.left+y,r=e.top+y,p=(s?t.originalEvent.touches[0]:t).pageX-n,c=(s?t.originalEvent.touches[0]:t).pageY-r,l=Math.sqrt(p*p+c*c),d=!1;if(!i||!(T-P>l||l>T+P)){t.preventDefault();var k=setTimeout(function(){a.addClass("clockpicker-moving")},200);m&&u.append(D.canvas),D.setHand(p,c,!0,!0),h.off(v).on(v,function(t){t.preventDefault();var i=/^touch/.test(t.type),e=(i?t.originalEvent.touches[0]:t).pageX-n,s=(i?t.originalEvent.touches[0]:t).pageY-r;(d||e!==p||s!==c)&&(d=!0,D.setHand(e,s,!0,!0))}),h.off(g).on(g,function(t){h.off(g),t.preventDefault();var i=/^touch/.test(t.type),e=(i?t.originalEvent.changedTouches[0]:t).pageX-n,s=(i?t.originalEvent.changedTouches[0]:t).pageY-r;D.setHand(e,s,!1,!0),"hours"===D.currentView?D.toggleView("minutes",x/2):o.twelveHour&&!D.amOrPmSelected&&o.autoClose?D.toggleView("ampm",x/2):D.autoCloseIfEnabled(),u.prepend(j),clearTimeout(k),a.removeClass("clockpicker-moving"),h.off(v)})}}var c=p(H),l=c.find(".clockpicker-popover-inner"),u=c.find(".clockpicker-plate"),d=c.find(".clockpicker-hours"),k=c.find(".clockpicker-minutes"),b=c.find(".clockpicker-am-pm-block"),w=c.find(".popover-content"),A=c.find(".popover-footer"),S=c.find(".clockpicker-span-blank"),M="INPUT"===t.prop("tagName"),B=o.noInput?null:M?t:t.find("input"),I=B&&"time"===B.prop("type"),O=t.find(".input-group-addon"),D=this;this.id=s("cp"),this.element=t,this.options=o,this.options.hourStep=this.parseStep(this.options.hourStep,12),this.options.minuteStep=this.parseStep(this.options.minuteStep,60),this.isAppended=!1,this.isShown=!1,this.currentView="hours",this.isInput=M,this.isHTML5=I,this.input=B,this.addon=O,this.popover=c,this.popoverInner=l,this.popoverContent=w,this.popoverTitle=c.find(".popover-title"),this.plate=u,this.hoursView=d,this.minutesView=k,this.amPmBlock=b,this.spanHours=c.find(".clockpicker-span-hours"),this.spanMinutes=c.find(".clockpicker-span-minutes"),this.spanAmPm=c.find(".clockpicker-span-am-pm"),this.amOrPm="",this.currentPlacementClass=o.placement,c.toggleClass("clockpicker-popover-inline",o.inline),b.toggleClass("clockpicker-am-pm-block-hidden",!o.twelveHour),S.html(o.blankTitle),o.twelveHour&&(p(''+o.amText+" ").on("click",function(){var t=D.amOrPm!==o.amText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.amText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock),p(''+o.pmText+" ").on("click",function(){var t=D.amOrPm!==o.pmText;t&&n(o.beforeChange,D.getTime(!0)),D.amOrPm=o.pmText,D.spanAmPm.empty().append(" "+D.amOrPm),t&&n(o.afterChange,D.getTime(!0)),D.amOrPmSelected=!0,D.isDisplayingAmPmView&&(D.toggleView("minutes",x/2,!0),D.autoCloseIfEnabled())}).appendTo(this.amPmBlock)),o.showNow&&p(''+o.nowText+" ").click(p.proxy(this.now,this)).appendTo(A),o.showClear&&p(''+o.clearText+" ").click(p.proxy(this.clear,this)).appendTo(A),o.showDone&&p(''+o.doneText+" ").click(p.proxy(this.done,this)).appendTo(A),!/^(top|bottom)/.test(o.placement)||"top"!==o.align&&"bottom"!==o.align||(o.align="left"),"left"!==o.placement&&"right"!==o.placement||"left"!==o.align&&"right"!==o.align||(o.align="top"),o.inline||(c.addClass(o.placement),c.addClass("clockpicker-align-"+o.align)),this.spanHours.click(p.proxy(this.toggleView,this,"hours")),this.spanMinutes.click(p.proxy(this.toggleView,this,"minutes")),o.twelveHour&&this.spanAmPm.click(p.proxy(this.toggleView,this,"ampm")),o.inline||(o.addonOnly||o.noInput||B.on("focus.clockpicker click.clockpicker",p.proxy(this.show,this)),O.on("click.clockpicker",p.proxy(this.toggle,this)));var E,L,N,z,W=p('
');if(o.twelveHour)for(E=0;12>E;E+=o.hourStep)L=W.clone(),N=E/6*Math.PI,z=T,L.css("font-size","120%"),L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),L.html(0===E?12:E),d.append(L),L.on(f,r);else for(E=0;24>E;E+=o.hourStep){L=W.clone(),N=E/6*Math.PI;var _=E>0&&13>E;z=_?C:T,L.css({left:y+Math.sin(N)*z-P,top:y-Math.cos(N)*z-P}),_&&L.css("font-size","120%"),L.html(0===E?"00":E),d.append(L),L.on(f,r)}var U=Math.max(o.minuteStep,5);for(E=0;60>E;E+=U)L=W.clone(),N=E/30*Math.PI,L.css({left:y+Math.sin(N)*T-P,top:y-Math.cos(N)*T-P}),L.css("font-size","120%"),L.html(e(E)),k.append(L),L.on(f,r);if(u.on(f,function(t){0===p(t.target).closest(".clockpicker-tick").length&&r(t,!0)}),m){var j=c.find(".clockpicker-canvas"),R=i("svg");R.setAttribute("class","clockpicker-svg"),R.setAttribute("width",V),R.setAttribute("height",V);var X=i("g");X.setAttribute("transform","translate("+y+","+y+")");var Y=i("circle");Y.setAttribute("class","clockpicker-canvas-bearing"),Y.setAttribute("cx",0),Y.setAttribute("cy",0),Y.setAttribute("r",2);var q=i("line");q.setAttribute("x1",0),q.setAttribute("y1",0);var F=i("circle");F.setAttribute("class","clockpicker-canvas-bg"),F.setAttribute("r",P);var G=i("circle");G.setAttribute("class","clockpicker-canvas-fg"),G.setAttribute("r",3.5),X.appendChild(q),X.appendChild(F),X.appendChild(G),X.appendChild(Y),R.appendChild(X),j.append(R),this.hand=q,this.bg=F,this.fg=G,this.bearing=Y,this.g=X,this.canvas=j}o.inline&&(a=this.element.append(this.popover),this.isAppended=!0,this.resetToInitialView()),n(this.options.init)}function n(t,i){t&&"function"==typeof t&&t(i)}function r(t,i,e){var s=i.outerHeight(),o=t.outerHeight(),n=t.offset().top,r=t.offset().top+o,a=n-t[0].getBoundingClientRect().top,p=a+document.documentElement.clientHeight,c=n-s>=a,h=p>=r+s;if("top"===e){if(c)return"top";if(h)return"bottom"}else{if(h)return"bottom";if(c)return"top"}return"viewport-top"}var a,p=window.jQuery,c=p(window),h=p(document),l=p(document.documentElement),u="http://www.w3.org/2000/svg",m="SVGAngle"in window&&function(){var t,i=document.createElement("div");return i.innerHTML=" ",t=(i.firstChild&&i.firstChild.namespaceURI)==u,i.innerHTML="",t}(),d=function(){var t=document.createElement("div").style;return"transition"in t||"WebkitTransition"in t||"MozTransition"in t||"msTransition"in t||"OTransition"in t}(),k="ontouchstart"in window,f="mousedown"+(k?" touchstart":""),v="mousemove.clockpicker"+(k?" touchmove.clockpicker":""),g="mouseup.clockpicker"+(k?" touchend.clockpicker":""),b=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,w=0,y=100,T=80,C=54,P=13,V=2*y,x=d?350:1,H=['','
','
','
','
',' ',' ',' : ',' ',' ',"
",'
",'","
","
","
"].join("");o.prototype.parseStep=function(t,i){return i%t===0?t:1},o.DEFAULTS={"default":"",fromNow:0,placement:"bottom",align:"left",doneText:"Done",clearText:"Clear",nowText:"Now",autoClose:!1,showClear:!1,showNow:!1,showDone:!0,twelveHour:!1,amText:"AM",pmText:"PM",vibrate:!0,hourStep:1,minuteStep:1,addonOnly:!1,setInput:!0,noInput:!1,showBlank:!1,blankTitle:"",preventScroll:!1,preventClose:!1,inline:!1,container:null,offset:null,klass:{amButton:null,pmButton:null,clearButton:null,nowButton:null,doneButton:null}},o.prototype.toggle=function(){this[this.isShown?"hide":"show"]()},o.prototype.updatePlacementClass=function(t){this.currentPlacementClass&&this.popover.removeClass(this.currentPlacementClass),t&&this.popover.addClass(t),this.currentPlacementClass=t},o.prototype.locate=function(){if(!this.options.inline){var t=this.element,i=this.popover,e=this.options.offset||t.offset(),s=t.outerWidth(),o=t.outerHeight(),n=this.options.placement,a=this.options.align,p={};if("top-adaptive"===n||"bottom-adaptive"===n){var c=n.substr(0,n.indexOf("-"));n=r(t,i,c),this.updatePlacementClass("viewport-top"!==n?n:"")}switch(this.popover.addClass("clockpicker-popover-open"),n){case"bottom":p.top=e.top+o;break;case"right":p.left=e.left+s;break;case"top":p.top=e.top-i.outerHeight();break;case"left":p.left=e.left-i.outerWidth();break;case"viewport-top":p.top=e.top-t[0].getBoundingClientRect().top}switch(a){case"left":p.left=e.left;break;case"right":p.left=e.left+s-i.outerWidth();break;case"top":p.top=e.top;break;case"bottom":p.top=e.top+o-i.outerHeight()}i.css(p)}},o.prototype.resetToInitialView=function(t){this.parseInputValue(),this.spanHours.html(this.options.showBlank&&this.hoursBlank?"__":e(this.hours)),this.spanMinutes.html(this.options.showBlank&&this.minutesBlank?"__":e(this.minutes)),this.options.twelveHour&&this.spanAmPm.empty().append(" "+this.amOrPm),this.toggleView(t?this.isDisplayingAmPmView?"ampm":this.currentView:"hours"),this.amOrPmSelected=!1},o.prototype.parseInputValue=function(){if(void 0===this.timeValue||!this.options.noInput){var t=this.timeValue||!this.options.noInput&&this.input.prop("value")||this.options["default"]||"";if(this.timeValue=null,"now"===t&&(t=new Date(+new Date+this.options.fromNow)),t instanceof Date&&(t=t.getHours()+":"+t.getMinutes()),t=t.split(":"),this.hours=(t[0]+"").replace(/[\D\s]/g,""),this.minutes=(t[1]+"").replace(/[\D\s]/g,""),this.hoursBlank=!this.hours,this.minutesBlank=!this.minutes,this.hours=+this.hours,this.minutes=+this.minutes,this.minutes&&(this.minutes=Math.round(this.minutes/this.options.minuteStep)*this.options.minuteStep),this.hours){this.hours=Math.round(this.hours/this.options.hourStep)*this.options.hourStep;var i=(t[1]+"").replace(/[\d\s]/g,"").toLowerCase(),e="am"===i||i===this.options.amText.toLowerCase(),s="pm"===i||i===this.options.pmText.toLowerCase();this.amOrPm=s?this.options.pmText:e?this.options.amText:"",this.options.twelveHour?(this.amOrPm||(this.amOrPm=this.hours>=12?this.options.pmText:this.options.amText),this.hours>12?this.hours-=12:0===this.hours&&(this.hours=12)):this.hours<12&&s?this.hours+=12:this.hours>=12&&e&&(this.hours-=12)}else this.amOrPm=this.options.pmText}},o.prototype.show=function(){if(!this.isShown&&!this.options.inline){n(this.options.beforeShow);var i=this;this.isAppended||(a=p(this.options.container||document.body).append(this.popover),c.on("resize.clockpicker"+this.id,function(){i.isShown&&i.locate()}),this.isAppended=!0),this.resetToInitialView(),this.locate(),this.isShown=!0,this.options.preventScroll&&l.css("overflow","hidden").css("padding-right","+="+t()),this.options.preventClose||(h.on("click.clockpicker."+this.id+" focusin.clockpicker."+this.id,function(t){var e=p(t.target);0===e.closest(i.popoverInner).length&&0===e.closest(i.addon).length&&0===e.closest(i.input).length&&i.hide()}),h.on("keyup.clockpicker."+this.id,function(t){27===t.keyCode&&i.hide()})),n(this.options.afterShow)}},o.prototype.hide=function(){this.options.inline||(n(this.options.beforeHide),this.isShown=!1,this.options.preventScroll&&l.css("overflow","").css("padding-right","-="+t()),h.off("click.clockpicker."+this.id+" focusin.clockpicker."+this.id),h.off("keyup.clockpicker."+this.id),this.popover.removeClass("clockpicker-popover-open"),n(this.options.afterHide))},o.prototype.toggleView=function(t,i,e){var s=!1;"minutes"===t&&"visible"===p(this.hoursView).css("visibility")&&(n(this.options.beforeHourSelect),s=!0);var o="hours"===t,r="minutes"===t,a=!o&&!r,c=o?this.hoursView:this.minutesView,h=o?this.minutesView:this.hoursView;t=a?"minutes":t,this.currentView=t,this.isDisplayingAmPmView=a,this.spanHours.toggleClass("text-primary",o),this.spanMinutes.toggleClass("text-primary",r),this.spanAmPm.toggleClass("text-primary",a),this.popoverContent.toggleClass("clockpicker-am-pm-active",a),h.addClass("clockpicker-dial-out"),c.css("visibility","visible").removeClass("clockpicker-dial-out"),e||this.resetClock(i),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(function(){h.css("visibility","hidden")},x),s&&n(this.options.afterHourSelect)},o.prototype.resetClock=function(t){if(!this.isDisplayingAmPmView){var i=this.currentView,e=this[i],s="hours"===i,o=Math.PI/(s?6:30),n=e*o,r=s&&e>0&&13>e?C:T,a=Math.sin(n)*r,p=-Math.cos(n)*r,c=this;m&&t?(c.canvas.addClass("clockpicker-canvas-out"),setTimeout(function(){c.canvas.removeClass("clockpicker-canvas-out"),c.setHand(a,p,!1,!1)},t)):this.setHand(a,p,!1,!1)}},o.prototype.setHand=function(t,i,s,o){if(!this.isDisplayingAmPmView){var r,a,c=Math.atan2(t,-i),h="hours"===this.currentView,l=Math.sqrt(t*t+i*i),u=this.options,d=h&&(T+C)/2>l,k=d?C:T;r=h?u.hourStep/6*Math.PI:u.minuteStep/30*Math.PI,u.twelveHour&&(k=T),0>c&&(c=2*Math.PI+c),a=Math.round(c/r),c=a*r,h?(a*=u.hourStep,u.twelveHour||!d!=a>0||(a+=12),u.twelveHour&&0===a&&(a=12),24===a&&(a=0)):(a*=u.minuteStep,60===a&&(a=0)),this[this.currentView]!==a&&b&&this.options.vibrate&&(this.vibrateTimer||(navigator[b](10),this.vibrateTimer=setTimeout(p.proxy(function(){this.vibrateTimer=null},this),100)));var f=this[this.currentView];o&&f!==a&&(n(u.beforeChange,this.getTime(!0)),this[this.currentView]=a,this[this.currentView+"Blank"]=!1);var v=u.showBlank&&this[this.currentView+"Blank"];this[h?"spanHours":"spanMinutes"].html(v?"__":e(a));var g=v&&!!u.blankTitle&&this[h?"minutesBlank":"hoursBlank"];if(this.popoverTitle.toggleClass("blank",g),!m&&!v)return this[h?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var t=p(this);t.toggleClass("active",a===+t.html())}),void 0;s||!h&&a%5?(this.g.insertBefore(this.hand,this.bearing),this.g.insertBefore(this.bg,this.fg),this.bg.setAttribute("class","clockpicker-canvas-bg clockpicker-canvas-bg-trans")):(this.g.insertBefore(this.hand,this.bg),this.g.insertBefore(this.fg,this.bg),this.bg.setAttribute("class","clockpicker-canvas-bg"));var w=Math.sin(c)*k,y=-Math.cos(c)*k;this.hand.setAttribute("x2",w),this.hand.setAttribute("y2",y),this.bg.setAttribute("cx",w),this.bg.setAttribute("cy",y),this.fg.setAttribute("cx",w),this.fg.setAttribute("cy",y),this.canvas.toggle(!v),o&&f!==a&&n(u.afterChange,this.getTime(!0))}},o.prototype.getTime=function(t,i){"function"==typeof t&&(i=t,t=!1),t||this.parseInputValue();var e=this.hours;this.options.twelveHour&&(12>e&&this.amOrPm===this.options.pmText?e+=12:e>=12&&this.amOrPm===this.options.amText&&(e-=12));var s=new Date;return s.setMinutes(this.minutes),s.setHours(e),s.setSeconds(0),this.options.showBlank&&this.hoursBlank?null:i&&i.apply(this.element,s)||s},o.prototype.setTime=function(t,i){this.timeValue=t,i&&this.resetToInitialView(!0)},o.prototype.done=function(){if(n(this.options.beforeDone),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),i=this.hours,s=":"+e(this.minutes);this.isHTML5&&this.options.twelveHour&&(this.hours<12&&this.amOrPm===this.options.pmText&&(i+=12),this.hours>=12&&this.amOrPm===this.options.amText&&(i-=12)),s=e(i)+s,!this.isHTML5&&this.options.twelveHour&&(s=s+" "+this.amOrPm),this.input.prop("value",s),s!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterDone)},o.prototype.clear=function(){if(n(this.options.beforeClear),this.hide(),this.options.setInput&&!this.options.noInput){var t=this.input.prop("value"),i=null;this.input.prop("value",i),i!==t&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))}n(this.options.afterClear)},o.prototype.now=function(){n(this.options.beforeChange,this.getTime(!0));var t=new Date;this.hours=t.getHours(),this.minutes=t.getMinutes(),this.options.twelveHour&&(this.amOrPm===this.options.amText,0===this.hours?this.hours=12:this.hours>12&&(this.amOrPm=this.options.pmText,this.hours-=12)),n(this.options.afterChange,this.getTime(!0)),this.done()},o.prototype.autoCloseIfEnabled=function(){var t=this.minutesBlank||this.hoursBlank;if(this.options.autoClose&&!t){var i=this;this.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){i.done()},x/2)}},o.prototype.remove=function(){this.element.removeData("clockpicker"),this.input&&this.input.off("focus.clockpicker click.clockpicker"),this.addon&&this.addon.off("click.clockpicker"),this.isShown&&this.hide(),this.isAppended&&(c.off("resize.clockpicker"+this.id),this.popover.remove())},p.fn.clockpicker=function(t){function i(){var i=p(this),s=i.data("clockpicker");if(s){if("function"==typeof s[t])return s[t].apply(s,e)}else{var n=p.extend({},o.DEFAULTS,i.data(),"object"==typeof t&&t);i.data("clockpicker",new o(i,n))}}var e=Array.prototype.slice.call(arguments,1);if(1==this.length){var s=i.apply(this[0]);return void 0!==s?s:this}return this.each(i)}}();
\ No newline at end of file
diff --git a/src/clockpicker.js b/src/clockpicker.js
index 49339af..20f2f74 100644
--- a/src/clockpicker.js
+++ b/src/clockpicker.js
@@ -620,6 +620,8 @@
// The input can be changed by the user
// So before we can use this.hours/this.minutes we must update it
ClockPicker.prototype.parseInputValue = function(){
+ if(this.timeValue !== undefined && this.options.noInput) return;
+
var value = this.timeValue || (!this.options.noInput && this.input.prop('value')) || this.options['default'] || '';
this.timeValue = null;