From 8c9e0a2221f228d9b330c4a5bc6924ed7d8f86ba Mon Sep 17 00:00:00 2001 From: Stefan Gabos Date: Thu, 28 Sep 2023 13:29:59 +0300 Subject: [PATCH] The minified version --- dist/zebra_datepicker.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/zebra_datepicker.min.js b/dist/zebra_datepicker.min.js index 0d2bb99..a789b98 100644 --- a/dist/zebra_datepicker.min.js +++ b/dist/zebra_datepicker.min.js @@ -1 +1 @@ -!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(Ze){"use strict";Ze.Zebra_DatePicker=function(e,q){var u,X,m,K,ee,te,f,b,y,p,v,se,w,k,ne,D,A,C,M,ie,P,F,ae,re,oe,Z,d,S,de,ce,x,Y,I,j,z,s,le,N,ge,H,O,L,c,T,R,W,_e={always_visible:!(this.version="1.9.19"),container:Ze("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_ampm:!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:"Pick a date",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},he={},B={},pe=!1,E="",ue=!1,me=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),Q=this,J=Ze(e),t=function(e){for(var t,s,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"]},i=null,r=!1,o=0;o<3;o++)E+=Math.floor(65536*(1+Math.random())).toString(16);if(k=[],ne=[],!e)for(t in Q.settings=Ze.extend({},_e,Ze.fn.Zebra_DatePicker.defaults,q),B.readonly=J.attr("readonly"),B.style=J.attr("style"),B.padding_left=parseInt(J.css("paddingLeft"),10)||0,B.padding_right=parseInt(J.css("paddingRight"),10)||0,J.data())0===t.indexOf("zdp_")&&(t=t.replace(/^zdp\_/,""),undefined!==_e[t])&&(Q.settings[t]="pair"===t?Ze(J.data("zdp_"+t)):J.data("zdp_"+t));for(Q.settings.readonly_element?J.attr("readonly","readonly"):J.removeAttr("readonly"),O=!1,R=[];!r;){for(i in n)Ze.each(n[i],function(e,t){var s,n;if(-1').css({display:J.css("display"),position:"static"===J.css("position")?"relative":J.css("position"),"float":J.css("float"),top:J.css("top"),right:J.css("right"),bottom:J.css("bottom"),left:J.css("left"),marginTop:p<0?p:0,marginRight:_<0?_:0,marginBottom:c<0?c:0,marginLeft:h<0?h:0,paddingTop:p,paddingRight:_,paddingBottom:c,paddingLeft:h}),"block"===J.css("display")&&p.css("width",J.outerWidth(!0)),J.wrap(p).css({position:"relative","float":"none",top:"auto",right:"auto",bottom:"auto",left:"auto",marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),F=Ze('"),Q.icon=F,Q.settings.open_icon_only?F:F.add(J)):J).on("click.Zebra_DatePicker_"+E+(Q.settings.open_on_focus?" focus.Zebra_DatePicker_"+E:""),function(){b.hasClass("dp_hidden")&&!J.attr("disabled")&&(!ue||Q.settings.readonly_element?Q.show():(clearTimeout(ge),ge=setTimeout(function(){Q.show()},600)))}),X.on("keydown.Zebra_DatePicker_"+E,function(e){9!==e.keyCode||b.hasClass("dp_hidden")||Q.hide()}),!Q.settings.readonly_element&&Q.settings.pair&&J.on("blur.Zebra_DatePicker_"+E,function(){var e;(e=fe(Ze(this).val()))&&!G(e.getFullYear(),e.getMonth(),e.getDate())&&Pe(e)}),undefined!==F&&F.insertAfter(J)),undefined!==F&&(F.attr("style",""),_=J.outerWidth(),c=J.outerHeight(),h=F.outerWidth(),p=F.outerHeight(),F.css("top",(c-p)/2),Q.settings.inside?"right"===Q.settings.icon_position?(F.css("right",!1!==Q.settings.icon_margin?Q.settings.icon_margin:B.padding_right),J.css("paddingRight",2*(!1!==Q.settings.icon_margin?Q.settings.icon_margin:B.padding_right)+h)):(F.css("left",!1!==Q.settings.icon_margin?Q.settings.icon_margin:B.padding_left),J.css("paddingLeft",2*(!1!==Q.settings.icon_margin?Q.settings.icon_margin:B.padding_left)+h)):F.css("left",_+(!1!==Q.settings.icon_margin?Q.settings.icon_margin:B.padding_left)),F.removeClass("Zebra_DatePicker_Icon_Disabled"),"disabled"===J.attr("disabled"))&&F.addClass("Zebra_DatePicker_Icon_Disabled")),le=!1!==Q.settings.show_select_today&&-1'+Q.settings.navigation[1]+(me?"︎":"")+'
',b=Ze(c),P=Ze("table.dp_header",b),y=Ze("table.dp_daypicker",b),Z=Ze("table.dp_monthpicker",b),L=Ze("table.dp_yearpicker",b),H=Ze("table.dp_timepicker",b),ie=Ze("table.dp_footer",b),z=Ze("td.dp_today",ie),u=Ze("td.dp_clear",ie),Y=Ze("td.dp_view_toggler",ie),m=Ze("td.dp_confirm",ie),Q.settings.always_visible instanceof jQuery?J.attr("disabled")||(Q.settings.always_visible.append(b),Q.show()):Q.settings.container.append(b),b.on("mouseover","td:not(.dp_disabled)",function(){Ze(this).addClass("dp_hover")}).on("mouseout","td:not(.dp_disabled)",function(){Ze(this).removeClass("dp_hover")}),be(b),Ze(Q.settings.rtl?".dp_next":".dp_previous",P).on("click",function(){"months"===T?j--:"years"===T?j-=12:--I<0&&(I=11,j--),U()}),Q.settings.fast_navigation&&Ze(".dp_caption",P).on("click",function(){T="days"===T?-1",Q.settings.show_week_number&&(t+=''+Q.settings.show_week_number+""),e=0;e<7;e++)s=(Q.settings.first_day_of_week+(Q.settings.rtl?6-e:e))%7,t+=''+(Ze.isArray(Q.settings.days_abbr)&&undefined!==Q.settings.days_abbr[s]?Q.settings.days_abbr[s]:Q.settings.days[s].substr(0,2))+"";for(t+="",e=0;e<42;e++)c=Q.settings.rtl?6-e%7*2:0,0"),e%7==0&&Q.settings.show_week_number&&(t+=''+ke(new Date(j,I,e-h+1))+""),s=e-h+1+c,Q.settings.select_other_months&&(e'+(Q.settings.select_other_months||Q.settings.show_other_months?V(c+_-h+e+1,Q.settings.zero_pad?2:0):" ")+"":l'+(Q.settings.select_other_months||Q.settings.show_other_months?V(s-l,Q.settings.zero_pad?2:0):" ")+"":(c="",o=we(j,I,s),d&&(c=" dp_weekend"),I===ee&&j===te&&K===s&&(c+=" dp_current"),""!==o&&(c+=" "+o),I===se&&j===w&&v===s&&(c+=" dp_selected"),G(j,I,s)&&(c+=" dp_disabled"),t+=""+((Q.settings.zero_pad?V(s,2):s)||" ")+"");y.html(Ze(t+="")),Q.settings.always_visible&&(p=Ze("td:not(.dp_disabled)",y)),y.show()},i=function(){Ae(Q.settings.header_captions.months);for(var e,t,s="",n=0;n<12;n++)0"),e="dp_month_"+(t=Q.settings.rtl?2+n-n%3*2:n),G(j,t)?e+=" dp_disabled":!1!==se&&se===t&&j===w?e+=" dp_selected":ee===t&&te===j&&(e+=" dp_current"),s+=''+(Ze.isArray(Q.settings.months_abbr)&&undefined!==Q.settings.months_abbr[t]?Q.settings.months_abbr[t]:Q.settings.months[t].substr(0,3))+"";Z.html(Ze(s+="")),Q.settings.always_visible&&(d=Ze("td:not(.dp_disabled)",Z)),Z.show()},a=function(){var e=O.hours&&O.minutes&&O.seconds&&O.ampm,t=''+(Q.settings.rtl&&O.ampm?''+Q.settings.navigation[2]+"":"")+(O.hours?''+Q.settings.navigation[2]+"":"")+(O.minutes?''+Q.settings.navigation[2]+"":"")+(O.seconds?''+Q.settings.navigation[2]+"":"")+(!Q.settings.rtl&&O.ampm?''+Q.settings.navigation[2]+"":"")+"";t+='',Q.settings.rtl&&O.ampm&&(t+='
'+("A"===O.ampm_case?x.toUpperCase():x)+"
"),O.hours&&(t+='
'+("h"===O.hour_format||"H"===O.hour_format?V(S,2):S)+"
"),O.minutes&&(t+='
'+V(de,2)+"
"),O.seconds&&(t+='
'+V(ce,2)+"
"),!Q.settings.rtl&&O.ampm&&(t+=''+("A"===O.ampm_case?x.toUpperCase():x)+""),t=t+''+(Q.settings.rtl&&O.ampm?''+Q.settings.navigation[3]+"":"")+(O.hours?''+Q.settings.navigation[3]+"":"")+(O.minutes?''+Q.settings.navigation[3]+"":"")+(O.seconds?''+Q.settings.navigation[3]+"":"")+(!Q.settings.rtl&&O.ampm?''+Q.settings.navigation[3]+"":"")+"",H.html(Ze(t)),H.show()},r=function(){Ae(Q.settings.header_captions.years);for(var e,t,s="",n=0;n<12;n++)0"),t=Q.settings.rtl?2+n-n%3*2:n,e="",G(j-7+t)?e+=" dp_disabled":w&&w===j-7+t?e+=" dp_selected":te===j-7+t&&(e+=" dp_current"),s+=""+(j-7+t)+"";L.html(Ze(s+="")),Q.settings.always_visible&&(c=Ze("td:not(.dp_disabled)",L)),L.show()},we=function(s,n,i){var a,e,r;for(e in void 0!==n&&(n+=1),f)if(a=f[e],r=!1,Ze.isArray(he[a])&&Ze.each(he[a],function(){var e,t;return!r&&(-1",{src:'javascript:document.write("")',scrolling:"no",frameborder:0,css:{zIndex:t,position:"absolute",top:-1e3,left:-1e3,width:b.outerWidth(),height:b.outerHeight(),filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)",display:"none"}}),Ze("body").append(s)),"hide"===e?s.hide():(t=b.offset(),s.css({top:t.top,left:t.left,display:"block"})))},G=function(s,n,i){var e,t,a,r;if(!(undefined!==s&&!isNaN(s)||undefined!==n&&!isNaN(n)||undefined!==i&&!isNaN(i)))return!1;if(s<1e3)return!0;if(Ze.isArray(Q.settings.direction)||0!==$(Q.settings.direction)){if(8===(t=((e=$(o(s,void 0!==n?V(n,2):"",void 0!==i?V(i,2):"")))+"").length)&&(void 0!==N&&e<$(o(M,V(C,2),V(A,2)))||void 0!==D&&e>$(o(oe,V(re,2),V(ae,2)))))return!0;if(6===t&&(void 0!==N&&e<$(o(M,V(C,2)))||void 0!==D&&e>$(o(oe,V(re,2)))))return!0;if(4===t&&(void 0!==N&&e=i.length?0:n+1:n-1<0?i.length-1:n-1;"hour"===e[1]?S=i[t]:"minute"===e[1]?de=i[t]:"second"===e[1]?ce=i[t]:x=i[t],v=(v=!v&&Q.settings.start_date&&(n=fe(Q.settings.start_date))?n.getDate():v)||A,s.text(V(i[t],2).toUpperCase()),Me(j,I,v)},Me=function(e,t,s,n,i){var a=new Date(e,t,s,O&&O.hours?S+(O.ampm?"pm"===x&&12!==S?12:"am"===x&&12===S?-12:0:0):12,O&&O.minutes?de:0,O&&O.seconds?ce:0),r="days"===n?p:"months"===n?d:c,o=ve(a);J.val(o),(Q.settings.always_visible||O)&&(se=a.getMonth(),I=a.getMonth(),w=a.getFullYear(),j=a.getFullYear(),v=a.getDate(),i)&&r&&(r.removeClass("dp_selected"),i.addClass("dp_selected"),"days"===n)&&i.hasClass("dp_not_in_month")&&!i.hasClass("dp_disabled")&&Q.show(),O?(T="time",U()):(J.focus(),Q.hide()),Pe(a),!O&&Q.settings.onSelect&&"function"==typeof Q.settings.onSelect&&Q.settings.onSelect.call(J,o,e+"-"+V(t+1,2)+"-"+V(s,2),a)},o=function(){for(var e="",t=0;t').css({display:J.css("display"),position:"static"===J.css("position")?"relative":J.css("position"),"float":J.css("float"),top:J.css("top"),right:J.css("right"),bottom:J.css("bottom"),left:J.css("left"),marginTop:u<0?u:0,marginRight:_<0?_:0,marginBottom:c<0?c:0,marginLeft:h<0?h:0,paddingTop:u,paddingRight:_,paddingBottom:c,paddingLeft:h}),J.wrap(u).css({position:"relative","float":"none",top:"auto",right:"auto",bottom:"auto",left:"auto",marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),F=Ze('"),Q.icon=F,Q.settings.open_icon_only?F:F.add(J)):J).on("click.Zebra_DatePicker_"+E+(Q.settings.open_on_focus?" focus.Zebra_DatePicker_"+E:""),function(){b.hasClass("dp_hidden")&&!J.attr("disabled")&&(!pe||Q.settings.readonly_element?Q.show():(clearTimeout(ge),ge=setTimeout(function(){Q.show()},600)))}),K.on("keydown.Zebra_DatePicker_"+E,function(e){9!==e.keyCode||b.hasClass("dp_hidden")||Q.hide()}),!Q.settings.readonly_element&&Q.settings.pair&&J.on("blur.Zebra_DatePicker_"+E,function(){var e;(e=fe(Ze(this).val()))&&!G(e.getFullYear(),e.getMonth(),e.getDate())&&Pe(e)}),undefined!==F&&F.insertAfter(J)),undefined!==F&&(F.attr("style",""),_=J.outerWidth(),c=J.outerHeight(),h=F.outerWidth(),u=F.outerHeight(),F.css("top",(c-u)/2),Q.settings.inside?"right"===Q.settings.icon_position?(F.css("right",!1!==Q.settings.icon_margin?Q.settings.icon_margin:W.padding_right),J.css("paddingRight",2*(!1!==Q.settings.icon_margin?Q.settings.icon_margin:W.padding_right)+h)):(F.css("left",!1!==Q.settings.icon_margin?Q.settings.icon_margin:W.padding_left),J.css("paddingLeft",2*(!1!==Q.settings.icon_margin?Q.settings.icon_margin:W.padding_left)+h)):F.css("left",_+(!1!==Q.settings.icon_margin?Q.settings.icon_margin:W.padding_left)),F.removeClass("Zebra_DatePicker_Icon_Disabled"),"disabled"===J.attr("disabled"))&&F.addClass("Zebra_DatePicker_Icon_Disabled")),le=!1!==Q.settings.show_select_today&&-1'+Q.settings.navigation[1]+(me?"︎":"")+'
',b=Ze(c),Q.datepicker=b,P=Ze("table.dp_header",b),y=Ze("table.dp_daypicker",b),Z=Ze("table.dp_monthpicker",b),L=Ze("table.dp_yearpicker",b),H=Ze("table.dp_timepicker",b),ie=Ze("table.dp_footer",b),z=Ze("td.dp_today",ie),p=Ze("td.dp_clear",ie),x=Ze("td.dp_view_toggler",ie),m=Ze("td.dp_confirm",ie),Q.settings.always_visible instanceof jQuery?J.attr("disabled")||(Q.settings.always_visible.append(b),Q.show()):Q.settings.container.append(b),b.on("mouseover","td:not(.dp_disabled)",function(){Ze(this).addClass("dp_hover")}).on("mouseout","td:not(.dp_disabled)",function(){Ze(this).removeClass("dp_hover")}),be(b),Ze(Q.settings.rtl?".dp_next":".dp_previous",P).on("click",function(){"months"===T?j--:"years"===T?j-=12:--I<0&&(I=11,j--),U()}),Q.settings.fast_navigation&&Ze(".dp_caption",P).on("click",function(){T="days"===T?-1",Q.settings.show_week_number&&(t+=''+Q.settings.show_week_number+""),e=0;e<7;e++)s=(Q.settings.first_day_of_week+(Q.settings.rtl?6-e:e))%7,t+=''+(Array.isArray(Q.settings.days_abbr)&&undefined!==Q.settings.days_abbr[s]?Q.settings.days_abbr[s]:Q.settings.days[s].substr(0,2))+"";for(t+="",e=0;e<42;e++)c=Q.settings.rtl?6-e%7*2:0,0"),e%7==0&&Q.settings.show_week_number&&(t+=''+ke(new Date(j,I,e-h+1))+""),s=e-h+1+c,Q.settings.select_other_months&&(e'+(Q.settings.select_other_months||Q.settings.show_other_months?V(c+_-h+e+1,Q.settings.zero_pad?2:0):" ")+"":l'+(Q.settings.select_other_months||Q.settings.show_other_months?V(s-l,Q.settings.zero_pad?2:0):" ")+"":(c="",o=we(j,I,s),d&&(c=" dp_weekend"),I===ee&&j===te&&X===s&&(c+=" dp_current"),""!==o&&(c+=" "+o),I===se&&j===w&&v===s&&(c+=" dp_selected"),G(j,I,s)&&(c+=" dp_disabled"),t+=""+((Q.settings.zero_pad?V(s,2):s)||" ")+"");y.html(Ze(t+="")),Q.settings.always_visible&&(u=Ze("td:not(.dp_disabled)",y)),y.show()},n=function(){De(Q.settings.header_captions.months);for(var e,t,s="",n=0;n<12;n++)0"),e="dp_month_"+(t=Q.settings.rtl?2+n-n%3*2:n),G(j,t)?e+=" dp_disabled":!1!==se&&se===t&&j===w?e+=" dp_selected":ee===t&&te===j&&(e+=" dp_current"),s+=''+(Array.isArray(Q.settings.months_abbr)&&undefined!==Q.settings.months_abbr[t]?Q.settings.months_abbr[t]:Q.settings.months[t].substr(0,3))+"";Z.html(Ze(s+="")),Q.settings.always_visible&&(d=Ze("td:not(.dp_disabled)",Z)),Z.show()},i=function(){var e=O.hours&&O.minutes&&O.seconds&&O.ampm,t=''+(Q.settings.rtl&&O.ampm?''+Q.settings.navigation[2]+"":"")+(O.hours?''+Q.settings.navigation[2]+"":"")+(O.minutes?''+Q.settings.navigation[2]+"":"")+(O.seconds?''+Q.settings.navigation[2]+"":"")+(!Q.settings.rtl&&O.ampm?''+Q.settings.navigation[2]+"":"")+"";t+='',Q.settings.rtl&&O.ampm&&(t+='
'+("A"===O.ampm_case?Y.toUpperCase():Y)+"
"),O.hours&&(t+='
'+("h"===O.hour_format||"H"===O.hour_format?V(S,2):S)+"
"),O.minutes&&(t+='
'+V(de,2)+"
"),O.seconds&&(t+='
'+V(ce,2)+"
"),!Q.settings.rtl&&O.ampm&&(t+=''+("A"===O.ampm_case?Y.toUpperCase():Y)+""),t=t+''+(Q.settings.rtl&&O.ampm?''+Q.settings.navigation[3]+"":"")+(O.hours?''+Q.settings.navigation[3]+"":"")+(O.minutes?''+Q.settings.navigation[3]+"":"")+(O.seconds?''+Q.settings.navigation[3]+"":"")+(!Q.settings.rtl&&O.ampm?''+Q.settings.navigation[3]+"":"")+"",H.html(Ze(t)),H.show()},a=function(){De(Q.settings.header_captions.years);for(var e,t,s="",n=0;n<12;n++)0"),t=Q.settings.rtl?2+n-n%3*2:n,e="",G(j-7+t)?e+=" dp_disabled":w&&w===j-7+t?e+=" dp_selected":te===j-7+t&&(e+=" dp_current"),s+=""+(j-7+t)+"";L.html(Ze(s+="")),Q.settings.always_visible&&(c=Ze("td:not(.dp_disabled)",L)),L.show()},we=function(s,n,i){var a,e,r;for(e in void 0!==n&&(n+=1),f)if(a=f[e],r=!1,Array.isArray(he[a])&&Ze.each(he[a],function(){var e,t;return!r&&(-1$(o(oe,V(re,2),V(ae,2)))))return!0;if(6===t&&(void 0!==N&&e<$(o(M,V(C,2)))||void 0!==A&&e>$(o(oe,V(re,2)))))return!0;if(4===t&&(void 0!==N&&e=i.length?0:n+1:n-1<0?i.length-1:n-1;"hour"===e[1]?S=i[t]:"minute"===e[1]?de=i[t]:"second"===e[1]?ce=i[t]:Y=i[t],v=(v=!v&&Q.settings.start_date&&(n=fe(Q.settings.start_date))?n.getDate():v)||D,s.text(V(i[t],2).toUpperCase()),Me(j,I,v)},Me=function(e,t,s,n,i){var a=new Date(e,t,s,O&&O.hours?S+(O.ampm?"pm"===Y&&12!==S?12:"am"===Y&&12===S?-12:0:0):12,O&&O.minutes?de:0,O&&O.seconds?ce:0),r="days"===n?u:"months"===n?d:c,o=ve(a);J.val(o),(Q.settings.always_visible||O)&&(se=a.getMonth(),I=a.getMonth(),w=a.getFullYear(),j=a.getFullYear(),v=a.getDate(),i)&&r&&(r.removeClass("dp_selected"),i.addClass("dp_selected"),"days"===n)&&i.hasClass("dp_not_in_month")&&!i.hasClass("dp_disabled")&&Q.show(),O?(T="time",U()):(J.focus(),Q.hide()),Pe(a),!O&&Q.settings.onSelect&&"function"==typeof Q.settings.onSelect&&Q.settings.onSelect.call(J,o,e+"-"+V(t+1,2)+"-"+V(s,2),a)},o=function(){for(var e="",t=0;t