diff --git a/dist/zebra_datepicker.min.js b/dist/zebra_datepicker.min.js index 9630aa7..db52be9 100644 --- a/dist/zebra_datepicker.min.js +++ b/dist/zebra_datepicker.min.js @@ -1 +1 @@ -!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(Nt){"use strict";Nt.Zebra_DatePicker=function(t,M){var P,F,Z,S,x,Y,I,z,j,m,N,H,O,L,T,R,W,B,E,Q,J,G,U,V,$,q,d,X,K,tt,et,st,it,nt,at,i,rt,ot,dt,ct,lt,gt,c,_t,ht,pt,ut={always_visible:!(this.version="1.9.13"),container:Nt("body"),current_date:!1,custom_classes:!1,days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],days_abbr:!1,default_position:"above",direction:0,disable_time_picker:!1,disabled_dates:!1,enabled_dates:!1,enabled_hours:!1,enabled_minutes:!1,enabled_seconds:!1,fast_navigation:!0,first_day_of_week:1,format:"Y-m-d",header_captions:{days:"F, Y",months:"Y",years:"Y1 - Y2"},icon_margin:!1,icon_position:"right",inside:!0,lang_clear_date:"Clear date",months:["January","February","March","April","May","June","July","August","September","October","November","December"],months_abbr:!1,navigation:["◀","▶","▲","▼"],offset:[5,-5],open_icon_only:!1,open_on_focus:!1,pair:!1,readonly_element:!0,rtl:!1,select_other_months:!1,show_clear_date:0,show_icon:!0,show_other_months:!0,show_select_today:"Today",show_week_number:!1,start_date:!1,strict:!1,view:"days",weekend_days:[0,6],zero_pad:!1,onChange:null,onClear:null,onOpen:null,onClose:null,onSelect:null},mt={},ft={},bt=!1,yt="",vt=!1,wt=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),kt=this,Dt=Nt(t),e=function(t){var e,s,i,a,n={days:["d","j","D"],months:["F","m","M","n","t"],years:["o","Y","y"],hours:["G","g","H","h"],minutes:["i"],seconds:["s"],ampm:["A","a"]},r=null,o=!1;for(i=0;i<3;i++)yt+=Math.floor(65536*(1+Math.random())).toString(16);if(L=[],T=[],!t)for(e in kt.settings=Nt.extend({},ut,Nt.fn.Zebra_DatePicker.defaults,M),ft.readonly=Dt.attr("readonly"),ft.style=Dt.attr("style"),ft.padding_left=parseInt(Dt.css("paddingLeft"),10)||0,ft.padding_right=parseInt(Dt.css("paddingRight"),10)||0,Dt.data())0===e.indexOf("zdp_")&&(e=e.replace(/^zdp\_/,""),void 0!==ut[e]&&(kt.settings[e]="pair"===e?Nt(Dt.data("zdp_"+e)):Dt.data("zdp_"+e)));for(kt.settings.readonly_element?Dt.attr("readonly","readonly"):Dt.removeAttr("readonly"),lt=!1,ht=[];!o;){for(r in n)Nt.each(n[r],function(t,e){var s,i;if(-1').css({display:Dt.css("display"),position:"static"===Dt.css("position")?"relative":Dt.css("position"),"float":Dt.css("float"),top:Dt.css("top"),right:Dt.css("right"),bottom:Dt.css("bottom"),left:Dt.css("left"),marginTop:m<0?m:0,marginRight:f<0?f:0,marginBottom:b<0?b:0,marginLeft:y<0?y:0,paddingTop:m,paddingRight:f,paddingBottom:b,paddingLeft:y});"block"===Dt.css("display")&&v.css("width",Dt.outerWidth(!0)),Dt.wrap(v).css({position:"relative","float":"none",top:"auto",right:"auto",bottom:"auto",left:"auto",marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),G=Nt(''),kt.icon=G,F=kt.settings.open_icon_only?G:G.add(Dt)}else F=Dt;F.on("click.Zebra_DatePicker_"+yt+(kt.settings.open_on_focus?" focus.Zebra_DatePicker_"+yt:""),function(){z.hasClass("dp_hidden")&&!Dt.attr("disabled")&&(!vt||kt.settings.readonly_element?kt.show():(clearTimeout(dt),dt=setTimeout(function(){kt.show()},600)))}),F.on("keydown.Zebra_DatePicker_"+yt,function(t){9!==t.keyCode||z.hasClass("dp_hidden")||kt.hide()}),!kt.settings.readonly_element&&kt.settings.pair&&Dt.on("blur.Zebra_DatePicker_"+yt,function(){var t;(t=At(Nt(this).val()))&&!Pt(t.getFullYear(),t.getMonth(),t.getDate())&&zt(t)}),void 0!==G&&G.insertAfter(Dt)}if(void 0!==G){G.attr("style","");var w=Dt.outerWidth(),k=Dt.outerHeight(),D=G.outerWidth(),A=G.outerHeight();G.css("top",(k-A)/2),kt.settings.inside?"right"===kt.settings.icon_position?(G.css("right",!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_right),Dt.css("paddingRight",2*(!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_right)+D)):(G.css("left",!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_left),Dt.css("paddingLeft",2*(!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_left)+D)):G.css("left",w+(!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_left)),G.removeClass("Zebra_DatePicker_Icon_Disabled"),"disabled"===Dt.attr("disabled")&&G.addClass("Zebra_DatePicker_Icon_Disabled")}}if(rt=!1!==kt.settings.show_select_today&&-1'+kt.settings.navigation[1]+(wt?"︎":"")+'
';z=Nt(C),J=Nt("table.dp_header",z),j=Nt("table.dp_daypicker",z),q=Nt("table.dp_monthpicker",z),gt=Nt("table.dp_yearpicker",z),ct=Nt("table.dp_timepicker",z),Q=Nt("table.dp_footer",z),at=Nt("td.dp_today",Q),P=Nt("td.dp_clear",Q),st=Nt("td.dp_view_toggler",Q),Z=Nt("td.dp_confirm",Q),kt.settings.always_visible instanceof jQuery?Dt.attr("disabled")||(kt.settings.always_visible.append(z),kt.show()):kt.settings.container.append(z),z.on("mouseover","td:not(.dp_disabled)",function(){Nt(this).addClass("dp_hover")}).on("mouseout","td:not(.dp_disabled)",function(){Nt(this).removeClass("dp_hover")}),Ct(z),Nt(kt.settings.rtl?".dp_next":".dp_previous",J).on("click",function(){"months"===_t?nt--:"years"===_t?nt-=12:--it<0&&(it=11,nt--),Zt()}),kt.settings.fast_navigation&&Nt(".dp_caption",J).on("click",function(){_t="days"===_t?-1",kt.settings.show_week_number&&(e+=""+kt.settings.show_week_number+""),t=0;t<7;t++)s=(kt.settings.first_day_of_week+(kt.settings.rtl?6-t:t))%7,e+=""+(Nt.isArray(kt.settings.days_abbr)&&void 0!==kt.settings.days_abbr[s]?kt.settings.days_abbr[s]:kt.settings.days[s].substr(0,2))+"";for(e+="",t=0;t<42;t++)g=kt.settings.rtl?6-t%7*2:0,0"),t%7==0&&kt.settings.show_week_number&&(e+=""+b(new Date(nt,it,t-u+1))+""),s=g+(t-u+1),kt.settings.select_other_months&&(t'+(kt.settings.select_other_months||kt.settings.show_other_months?Yt(g+p-u+t+1,kt.settings.zero_pad?2:0):" ")+"":_'+(kt.settings.select_other_months||kt.settings.show_other_months?Yt(s-_,kt.settings.zero_pad?2:0):" ")+"":(d="",c=f(nt,it,s),l&&(d=" dp_weekend"),it===x&&nt===Y&&S===s&&(d+=" dp_current"),""!==c&&(d+=" "+c),it===H&&nt===O&&N===s&&(d+=" dp_selected"),Pt(nt,it,s)&&(d+=" dp_disabled"),e+=""+((kt.settings.zero_pad?Yt(s,2):s)||" ")+"");e+="",j.html(Nt(e)),kt.settings.always_visible&&(m=Nt("td:not(.dp_disabled)",j)),j.show()},f=function(s,i,n){var a,t,r;for(t in void 0!==i&&(i+=1),I)if(a=I[t],r=!1,Nt.isArray(mt[a])&&Nt.each(mt[a],function(){if(!r){var t,e=this;if((-1",{src:'javascript:document.write("")',scrolling:"no",frameborder:0,css:{zIndex:e,position:"absolute",top:-1e3,left:-1e3,width:z.outerWidth(),height:z.outerHeight(),filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)",display:"none"}}),Nt("body").append(i)),t){case"hide":i.hide();break;default:s=z.offset(),i.css({top:s.top,left:s.left,display:"block"})}},Pt=function(s,i,n){var t,e,a,r;if(!(void 0!==s&&!isNaN(s)||void 0!==i&&!isNaN(i)||void 0!==n&&!isNaN(n)))return!1;if(s<1e3)return!0;if(Nt.isArray(kt.settings.direction)||0!==It(kt.settings.direction)){if(8===(e=((t=It(o(s,void 0!==i?Yt(i,2):"",void 0!==n?Yt(n,2):"")))+"").length)&&(void 0!==ot&&tIt(o($,Yt(V,2),Yt(U,2)))))return!0;if(6===e&&(void 0!==ot&&tIt(o($,Yt(V,2)))))return!0;if(4===e&&(void 0!==ot&&t"),e="dp_month_"+(s=kt.settings.rtl?2+t-t%3*2:t),Pt(nt,s)?e+=" dp_disabled":!1!==H&&H===s&&nt===O?e+=" dp_selected":x===s&&Y===nt&&(e+=" dp_current"),i+=''+(Nt.isArray(kt.settings.months_abbr)&&void 0!==kt.settings.months_abbr[s]?kt.settings.months_abbr[s]:kt.settings.months[s].substr(0,3))+"";i+="",q.html(Nt(i)),kt.settings.always_visible&&(d=Nt("td:not(.dp_disabled)",q)),q.show()}(),j.hide(),gt.hide(),ct.hide(),st.hide(),Z.hide()):"years"===_t?(!function(){y(kt.settings.header_captions.years);var t,e,s,i="";for(t=0;t<12;t++)0"),s=kt.settings.rtl?2+t-t%3*2:t,e="",Pt(nt-7+s)?e+=" dp_disabled":O&&O===nt-7+s?e+=" dp_selected":Y===nt-7+s&&(e+=" dp_current"),i+=""+(nt-7+s)+"";i+="",gt.html(Nt(i)),kt.settings.always_visible&&(c=Nt("td:not(.dp_disabled)",gt)),gt.show()}(),j.hide(),q.hide(),ct.hide(),st.hide(),Z.hide()):"time"===_t&&(n=lt.hours&<.minutes&<.seconds&<.ampm,i=''+(kt.settings.rtl&<.ampm?''+kt.settings.navigation[2]+"":"")+(lt.hours?''+kt.settings.navigation[2]+"":"")+(lt.minutes?''+kt.settings.navigation[2]+"":"")+(lt.seconds?''+kt.settings.navigation[2]+"":"")+(!kt.settings.rtl&<.ampm?''+kt.settings.navigation[2]+"":"")+"",i+='',kt.settings.rtl&<.ampm&&(i+='
'+et.toUpperCase()+"
"),lt.hours&&(i+='
'+("h"===lt.hour_format||"H"===lt.hour_format?Yt(X,2):X)+"
"),lt.minutes&&(i+='
'+Yt(K,2)+"
"),lt.seconds&&(i+='
'+Yt(tt,2)+"
"),!kt.settings.rtl&<.ampm&&(i+=''+et.toUpperCase()+""),i+="",i+=''+(kt.settings.rtl&<.ampm?''+kt.settings.navigation[3]+"":"")+(lt.hours?''+kt.settings.navigation[3]+"":"")+(lt.minutes?''+kt.settings.navigation[3]+"":"")+(lt.seconds?''+kt.settings.navigation[3]+"":"")+(!kt.settings.rtl&<.ampm?''+kt.settings.navigation[3]+"":"")+"",ct.html(Nt(i)),ct.show(),1===ht.length?(st.hide(),Z.show()):(st.show().addClass("dp_calendar"),""===Dt.val()?Z.hide():Z.show()),J.hide(),j.hide(),q.hide(),gt.hide()),!1!==t&&kt.settings.onChange&&"function"==typeof kt.settings.onChange&&void 0!==_t&&((s="days"===_t?j.find("td:not(.dp_disabled)"):"months"===_t?q.find("td:not(.dp_disabled)"):"years"===_t?gt.find("td:not(.dp_disabled)"):ct.find(".dp_time_segments td")).each(function(){var t;"days"===_t?Nt(this).hasClass("dp_not_in_month")&&!Nt(this).hasClass("dp_disabled")?(t=Nt(this).attr("class").match(/date\_([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])/),Nt(this).data("date",t[1]+"-"+t[2]+"-"+t[3])):Nt(this).data("date",nt+"-"+Yt(it+1,2)+"-"+Yt(It(Nt(this).text()),2)):"months"===_t?(t=Nt(this).attr("class").match(/dp\_month\_([0-9]+)/),Nt(this).data("date",nt+"-"+Yt(It(t[1])+1,2))):"years"===_t&&Nt(this).data("date",It(Nt(this).text()))}),kt.settings.onChange.call(Dt,_t,s)),Q.show(),"time"===_t&&1=r.length?0:o+1:o-1<0?r.length-1:o-1;"hour"===i[1]?X=r[d]:"minute"===i[1]?K=r[d]:"second"===i[1]?tt=r[d]:et=r[d],!N&&kt.settings.start_date&&(e=At(kt.settings.start_date))&&(N=e.getDate()),N||(N=W),n.text(Yt(r[d],2).toUpperCase()),xt(nt,it,N)},xt=function(t,e,s,i,n){var a=new Date(t,e,s,lt&<.hours?X+(lt.ampm?"pm"===et&&12!==X?12:"am"===et&&12===X?-12:0:0):12,lt&<.minutes?K:0,lt&<.seconds?tt:0),r="days"===i?m:"months"===i?d:c,o=Mt(a);Dt.val(o),(kt.settings.always_visible||lt)&&(H=a.getMonth(),it=a.getMonth(),O=a.getFullYear(),nt=a.getFullYear(),N=a.getDate(),n&&r&&(r.removeClass("dp_selected"),n.addClass("dp_selected"),"days"===i&&n.hasClass("dp_not_in_month")&&!n.hasClass("dp_disabled")&&kt.show())),lt?(_t="time",Zt()):(Dt.focus(),kt.hide()),zt(a),!lt&&kt.settings.onSelect&&"function"==typeof kt.settings.onSelect&&kt.settings.onSelect.call(Dt,o,t+"-"+Yt(e+1,2)+"-"+Yt(s,2),a)},o=function(){var t,e="";for(t=0;t').css({display:Dt.css("display"),position:"static"===Dt.css("position")?"relative":Dt.css("position"),"float":Dt.css("float"),top:Dt.css("top"),right:Dt.css("right"),bottom:Dt.css("bottom"),left:Dt.css("left"),marginTop:m<0?m:0,marginRight:f<0?f:0,marginBottom:b<0?b:0,marginLeft:y<0?y:0,paddingTop:m,paddingRight:f,paddingBottom:b,paddingLeft:y});"block"===Dt.css("display")&&v.css("width",Dt.outerWidth(!0)),Dt.wrap(v).css({position:"relative","float":"none",top:"auto",right:"auto",bottom:"auto",left:"auto",marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),G=Nt(''),kt.icon=G,F=kt.settings.open_icon_only?G:G.add(Dt)}else F=Dt;F.on("click.Zebra_DatePicker_"+yt+(kt.settings.open_on_focus?" focus.Zebra_DatePicker_"+yt:""),function(){z.hasClass("dp_hidden")&&!Dt.attr("disabled")&&(!vt||kt.settings.readonly_element?kt.show():(clearTimeout(dt),dt=setTimeout(function(){kt.show()},600)))}),F.on("keydown.Zebra_DatePicker_"+yt,function(t){9!==t.keyCode||z.hasClass("dp_hidden")||kt.hide()}),!kt.settings.readonly_element&&kt.settings.pair&&Dt.on("blur.Zebra_DatePicker_"+yt,function(){var t;(t=At(Nt(this).val()))&&!Pt(t.getFullYear(),t.getMonth(),t.getDate())&&zt(t)}),void 0!==G&&G.insertAfter(Dt)}if(void 0!==G){G.attr("style","");var w=Dt.outerWidth(),k=Dt.outerHeight(),D=G.outerWidth(),A=G.outerHeight();G.css("top",(k-A)/2),kt.settings.inside?"right"===kt.settings.icon_position?(G.css("right",!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_right),Dt.css("paddingRight",2*(!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_right)+D)):(G.css("left",!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_left),Dt.css("paddingLeft",2*(!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_left)+D)):G.css("left",w+(!1!==kt.settings.icon_margin?kt.settings.icon_margin:ft.padding_left)),G.removeClass("Zebra_DatePicker_Icon_Disabled"),"disabled"===Dt.attr("disabled")&&G.addClass("Zebra_DatePicker_Icon_Disabled")}}if(rt=!1!==kt.settings.show_select_today&&-1'+kt.settings.navigation[1]+(wt?"︎":"")+'
';z=Nt(C),J=Nt("table.dp_header",z),j=Nt("table.dp_daypicker",z),q=Nt("table.dp_monthpicker",z),gt=Nt("table.dp_yearpicker",z),ct=Nt("table.dp_timepicker",z),Q=Nt("table.dp_footer",z),at=Nt("td.dp_today",Q),P=Nt("td.dp_clear",Q),st=Nt("td.dp_view_toggler",Q),Z=Nt("td.dp_confirm",Q),kt.settings.always_visible instanceof jQuery?Dt.attr("disabled")||(kt.settings.always_visible.append(z),kt.show()):kt.settings.container.append(z),z.on("mouseover","td:not(.dp_disabled)",function(){Nt(this).addClass("dp_hover")}).on("mouseout","td:not(.dp_disabled)",function(){Nt(this).removeClass("dp_hover")}),Ct(z),Nt(kt.settings.rtl?".dp_next":".dp_previous",J).on("click",function(){"months"===_t?nt--:"years"===_t?nt-=12:--it<0&&(it=11,nt--),Zt()}),kt.settings.fast_navigation&&Nt(".dp_caption",J).on("click",function(){_t="days"===_t?-1",kt.settings.show_week_number&&(e+=""+kt.settings.show_week_number+""),t=0;t<7;t++)s=(kt.settings.first_day_of_week+(kt.settings.rtl?6-t:t))%7,e+=""+(Nt.isArray(kt.settings.days_abbr)&&void 0!==kt.settings.days_abbr[s]?kt.settings.days_abbr[s]:kt.settings.days[s].substr(0,2))+"";for(e+="",t=0;t<42;t++)g=kt.settings.rtl?6-t%7*2:0,0"),t%7==0&&kt.settings.show_week_number&&(e+=""+b(new Date(nt,it,t-u+1))+""),s=g+(t-u+1),kt.settings.select_other_months&&(t'+(kt.settings.select_other_months||kt.settings.show_other_months?Yt(g+p-u+t+1,kt.settings.zero_pad?2:0):" ")+"":_'+(kt.settings.select_other_months||kt.settings.show_other_months?Yt(s-_,kt.settings.zero_pad?2:0):" ")+"":(d="",c=f(nt,it,s),l&&(d=" dp_weekend"),it===x&&nt===Y&&S===s&&(d+=" dp_current"),""!==c&&(d+=" "+c),it===H&&nt===O&&N===s&&(d+=" dp_selected"),Pt(nt,it,s)&&(d+=" dp_disabled"),e+=""+((kt.settings.zero_pad?Yt(s,2):s)||" ")+"");e+="",j.html(Nt(e)),kt.settings.always_visible&&(m=Nt("td:not(.dp_disabled)",j)),j.show()},f=function(s,i,n){var a,t,r;for(t in void 0!==i&&(i+=1),I)if(a=I[t],r=!1,Nt.isArray(mt[a])&&Nt.each(mt[a],function(){if(!r){var t,e=this;if((-1",{src:'javascript:document.write("")',scrolling:"no",frameborder:0,css:{zIndex:e,position:"absolute",top:-1e3,left:-1e3,width:z.outerWidth(),height:z.outerHeight(),filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)",display:"none"}}),Nt("body").append(i)),t){case"hide":i.hide();break;default:s=z.offset(),i.css({top:s.top,left:s.left,display:"block"})}},Pt=function(s,i,n){var t,e,a,r;if(!(void 0!==s&&!isNaN(s)||void 0!==i&&!isNaN(i)||void 0!==n&&!isNaN(n)))return!1;if(s<1e3)return!0;if(Nt.isArray(kt.settings.direction)||0!==It(kt.settings.direction)){if(8===(e=((t=It(o(s,void 0!==i?Yt(i,2):"",void 0!==n?Yt(n,2):"")))+"").length)&&(void 0!==ot&&tIt(o($,Yt(V,2),Yt(U,2)))))return!0;if(6===e&&(void 0!==ot&&tIt(o($,Yt(V,2)))))return!0;if(4===e&&(void 0!==ot&&t"),e="dp_month_"+(s=kt.settings.rtl?2+t-t%3*2:t),Pt(nt,s)?e+=" dp_disabled":!1!==H&&H===s&&nt===O?e+=" dp_selected":x===s&&Y===nt&&(e+=" dp_current"),i+=''+(Nt.isArray(kt.settings.months_abbr)&&void 0!==kt.settings.months_abbr[s]?kt.settings.months_abbr[s]:kt.settings.months[s].substr(0,3))+"";i+="",q.html(Nt(i)),kt.settings.always_visible&&(d=Nt("td:not(.dp_disabled)",q)),q.show()}(),j.hide(),gt.hide(),ct.hide(),st.hide(),Z.hide()):"years"===_t?(!function(){y(kt.settings.header_captions.years);var t,e,s,i="";for(t=0;t<12;t++)0"),s=kt.settings.rtl?2+t-t%3*2:t,e="",Pt(nt-7+s)?e+=" dp_disabled":O&&O===nt-7+s?e+=" dp_selected":Y===nt-7+s&&(e+=" dp_current"),i+=""+(nt-7+s)+"";i+="",gt.html(Nt(i)),kt.settings.always_visible&&(c=Nt("td:not(.dp_disabled)",gt)),gt.show()}(),j.hide(),q.hide(),ct.hide(),st.hide(),Z.hide()):"time"===_t&&(n=lt.hours&<.minutes&<.seconds&<.ampm,i=''+(kt.settings.rtl&<.ampm?''+kt.settings.navigation[2]+"":"")+(lt.hours?''+kt.settings.navigation[2]+"":"")+(lt.minutes?''+kt.settings.navigation[2]+"":"")+(lt.seconds?''+kt.settings.navigation[2]+"":"")+(!kt.settings.rtl&<.ampm?''+kt.settings.navigation[2]+"":"")+"",i+='',kt.settings.rtl&<.ampm&&(i+='
'+et.toUpperCase()+"
"),lt.hours&&(i+='
'+("h"===lt.hour_format||"H"===lt.hour_format?Yt(X,2):X)+"
"),lt.minutes&&(i+='
'+Yt(K,2)+"
"),lt.seconds&&(i+='
'+Yt(tt,2)+"
"),!kt.settings.rtl&<.ampm&&(i+=''+et.toUpperCase()+""),i+="",i+=''+(kt.settings.rtl&<.ampm?''+kt.settings.navigation[3]+"":"")+(lt.hours?''+kt.settings.navigation[3]+"":"")+(lt.minutes?''+kt.settings.navigation[3]+"":"")+(lt.seconds?''+kt.settings.navigation[3]+"":"")+(!kt.settings.rtl&<.ampm?''+kt.settings.navigation[3]+"":"")+"",ct.html(Nt(i)),ct.show(),1===ht.length?(st.hide(),Z.show()):(st.show().addClass("dp_calendar"),""===Dt.val()?Z.hide():Z.show()),J.hide(),j.hide(),q.hide(),gt.hide()),!1!==t&&kt.settings.onChange&&"function"==typeof kt.settings.onChange&&void 0!==_t&&((s="days"===_t?j.find("td:not(.dp_disabled)"):"months"===_t?q.find("td:not(.dp_disabled)"):"years"===_t?gt.find("td:not(.dp_disabled)"):ct.find(".dp_time_segments td")).each(function(){var t;"days"===_t?Nt(this).hasClass("dp_not_in_month")&&!Nt(this).hasClass("dp_disabled")?(t=Nt(this).attr("class").match(/date\_([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])/),Nt(this).data("date",t[1]+"-"+t[2]+"-"+t[3])):Nt(this).data("date",nt+"-"+Yt(it+1,2)+"-"+Yt(It(Nt(this).text()),2)):"months"===_t?(t=Nt(this).attr("class").match(/dp\_month\_([0-9]+)/),Nt(this).data("date",nt+"-"+Yt(It(t[1])+1,2))):"years"===_t&&Nt(this).data("date",It(Nt(this).text()))}),kt.settings.onChange.call(Dt,_t,s)),Q.show(),"time"===_t&&1=r.length?0:o+1:o-1<0?r.length-1:o-1;"hour"===i[1]?X=r[d]:"minute"===i[1]?K=r[d]:"second"===i[1]?tt=r[d]:et=r[d],!N&&kt.settings.start_date&&(e=At(kt.settings.start_date))&&(N=e.getDate()),N||(N=W),n.text(Yt(r[d],2).toUpperCase()),xt(nt,it,N)},xt=function(t,e,s,i,n){var a=new Date(t,e,s,lt&<.hours?X+(lt.ampm?"pm"===et&&12!==X?12:"am"===et&&12===X?-12:0:0):12,lt&<.minutes?K:0,lt&<.seconds?tt:0),r="days"===i?m:"months"===i?d:c,o=Mt(a);Dt.val(o),(kt.settings.always_visible||lt)&&(H=a.getMonth(),it=a.getMonth(),O=a.getFullYear(),nt=a.getFullYear(),N=a.getDate(),n&&r&&(r.removeClass("dp_selected"),n.addClass("dp_selected"),"days"===i&&n.hasClass("dp_not_in_month")&&!n.hasClass("dp_disabled")&&kt.show())),lt?(_t="time",Zt()):(Dt.focus(),kt.hide()),zt(a),!lt&&kt.settings.onSelect&&"function"==typeof kt.settings.onSelect&&kt.settings.onSelect.call(Dt,o,t+"-"+Yt(e+1,2)+"-"+Yt(s,2),a)},o=function(){var t,e="";for(t=0;t