diff --git a/dist/zebra_datepicker.min.js b/dist/zebra_datepicker.min.js index 28992b6..a03e0e2 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){function e(t){var e,s,n,a,i={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(n=0;n<3;n++)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 i)Nt.each(i[r],function(t,e){var s,n;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(){j.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||j.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())&&jt(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?"︎":"")+'
';j=Nt(C),J=Nt("table.dp_header",j),z=Nt("table.dp_daypicker",j),q=Nt("table.dp_monthpicker",j),gt=Nt("table.dp_yearpicker",j),ct=Nt("table.dp_timepicker",j),Q=Nt("table.dp_footer",j),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(j),kt.show()):kt.settings.container.append(j),j.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(j),Nt(kt.settings.rtl?".dp_next":".dp_previous",J).on("click",function(){"months"===_t?it--:"years"===_t?it-=12:--nt<0&&(nt=11,it--),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(it,nt,t-u+1))+""),s=t-u+1+g,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(it,nt,s),l&&(d=" dp_weekend"),nt===x&&it===Y&&S===s&&(d+=" dp_current"),""!==c&&(d+=" "+c),nt===H&&it===O&&N===s&&(d+=" dp_selected"),Pt(it,nt,s)&&(d+=" dp_disabled"),e+=""+((kt.settings.zero_pad?Yt(s,2):s)||" ")+"");e+="",z.html(Nt(e)),kt.settings.always_visible&&(m=Nt("td:not(.dp_disabled)",z)),z.show()}function g(t){var e,s;if("explorer"===zt.name&&6===zt.version)switch(n||(e=It(j.css("zIndex"))-1,n=Nt("