",i=[],e=0;12>e;e++)f=o+e,n=[],!g.isInRange([f],r,s)||z&&a(c.orig).triggerHandler("validatevalue",[{value:f,valueAsDate:null,isPartial:[f]}])?h=' disabled=""':(h="",w++),f==k[0]&&n.push("this-value"),u[0]==f&&n.push("checked-value"),m=n.length?' class="'+n.join(" ")+'"':"",!e||e%t||(y++,i.push('
')),i.push(''+f+" ");d==q-1&&(l=g.isInRange([f+1],r,s)?{"data-action":"setYearList",value:f+1}:!1),x+='"}return{enabled:w,main:x,next:l,prev:j,type:"Grid"}},g.getMonthList=function(b,c){var d,e,f,h,i,j,l,m,n,p,q=c.options,s=q.size,t=q.maxS,u=q.minS,v=q.cols||4,w=q.value.split("-"),x=0,y=0,z="",A="month"==c.type?"changeInput":"setDayList",B=c.orig&&"validatevalue"in a.data(c.orig),C="changeInput"!=A;for(b=b[0]-Math.floor((s-1)/2),d=0;s>d;d++){for(d?b++:l=g.isInRange([b-1],t,u)?{"data-action":"setMonthList",value:b-1}:!1,d==s-1&&(m=g.isInRange([b+1],t,u)?{"data-action":"setMonthList",value:b+1}:!1),j=[],i=g.isInRange([b,"01"],t,u)||g.isInRange([b,"12"],t,u)?"":' disabled=""',q.minView>=1&&(i=' disabled=""'),z+='",e=0;12>e;e++)h=o.date.monthkeys[e+1],f=r(e),p=[],!g.isInRange([b,h],t,u)||B&&a(c.orig).triggerHandler("validatevalue",[{value:b+"-"+h,valueAsDate:c.asDate(b+"-"+h),isPartial:C&&[b,h]}])?i=' disabled=""':(i="",x++),b==k[0]&&k[1]==h&&p.push("this-value"),w[0]==b&&w[1]==h&&p.push("checked-value"),n=p.length?' class="'+p.join(" ")+'"':"",!e||e%v||(y++,j.push('
')),j.push(''+f+" ");z+='"}return{enabled:x,main:z,prev:l,next:m,type:"Grid"}},g.getDayList=function(b,c){var d,e,f,h,i,l,m,n,p,q,s,t,u,v,w,x,y,z,A,B,C,D=c.options,E=D.size,F=D.maxS,G=D.minS,H=D.value.split("T")[0].split("-"),I=o.date,J=[],K=new Date(b[0],b[1]-1,1),L="datetime-local"==c.type?"setTimeList":"changeInput",M=c.orig&&"validatevalue"in a.data(c.orig),N="changeInput"!=L;for(K.setMonth(K.getMonth()-Math.floor((E-1)/2)),n=[1*b[0]+1,b[1]],n=g.isInRange(n,F,G)?{"data-action":"setDayList",value:n.join("-")}:!1,p=[1*b[0]-1,b[1]],p=g.isInRange(p,F,G)?{"data-action":"setDayList",value:p.join("-")}:!1,d=0;E>d;d++){for(K.setDate(1),u=K.getMonth(),t=0,d||(B=new Date(K.getTime()),B.setDate(-1),x=j(B),l=g.isInRange(x,F,G)?{"data-action":"setDayList",value:x[0]+"-"+x[1]}:!1),x=j(K),J.push(''),J.push('"),f=I.firstDay;f'+I.dayNamesShort[f]+" ");for(f=I.firstDay;f--;)J.push(''+I.dayNamesShort[f]+" ");for(J.push(' '),s=g.getWeek(K),J.push(''+s+" "),e=0;99>e;e++){if(q=e&&!(e%7),v=K.getMonth(),w=u!=v,h=K.getDay(),C=[],q&&w&&t>=5){J.push(" ");break}q&&(t++,J.push(''),s++,s>52&&(s=g.getWeek(K)),J.push(''+s+" ")),e||h!=o.date.firstDay&&(i=h-o.date.firstDay,0>i&&(i+=7),K.setDate(K.getDate()-i),h=K.getDay(),v=K.getMonth(),w=u!=v),x=j(K),A=''+K.getDate()+" "),K.setDate(K.getDate()+1)}J.push("
"),d==E-1&&(x=j(K),x[2]=1,m=g.isInRange(x,F,G)?{"data-action":"setDayList",value:x.date}:!1)}return{enabled:9,main:J.join(""),prev:l,next:m,yearPrev:p,yearNext:n,type:"Grid"}},g.getTimeList=function(c,d){var e,f,g,h,j,k='',l=0,m=0,n=23,p={min:a.prop(d.orig,"min"),max:a.prop(d.orig,"max"),step:a.prop(d.orig,"step")},q=d.orig&&"validatevalue"in a.data(d.orig),s="";for("time"==d.type?e='
'+a.trim(a(d.orig).jProp("labels").text()||"").replace(/[\:\*]/g,"")+" ":(f=c[2].split("T"),c[2]=f[0],f[1]&&(c[3]=f[1]),s=' aria-label="'+c[2]+". "+o.date.monthNames[1*c[1]-1]+" "+c[0]+'"',e=r(1*c[1]-1,c[0],c[2]+". "),e='
'+e+" ",j=c[0]+"-"+c[1]+"-"+c[2]+"T"),k+='",k+='
";n>=l;l++)g=i.addZero(""+l)+":00",h=j?j+g:g,!l||l%4||(m++,k+=' '),k+='"+b._format.time(g)+" ";return k+="
",{enabled:9,main:k,prev:!1,next:!1,type:"Grid"}},g.isInRange=function(a,b,c){var d,e=!0;for(d=0;da[d]){e=!1;break}if(!c[d]||c[d]!=a[d])break}if(e)for(d=0;d"+d[f]+"");return h},function(){var c=function(a){return"get"+a+"List"},d=function(a){return"set"+a+"List"},e={date:"Day",week:"Day",month:"Month","datetime-local":"Time",time:"Time"},f=function(a,b,c){a[c]?b[c+"Element"].attr(a[c]).prop({disabled:!1}).prop(a[c]):b[c+"Element"].removeAttr("data-action").prop({disabled:!0})};a.each({setYearList:["Year","Month","Day","Time"],setMonthList:["Month","Day","Time"],setDayList:["Day","Time"],setTimeList:["Time"]},function(i,j){var k=j.map(c),l=j.map(d);h[i]=function(c,d,h,i){c=""+c;var m=h.options,n=c.split("-");i||(i=0),a.each(k,function(c,k){if(c>=i){var o=g[k](n,h);if(n.length<2||o.enabled>1||o.prev||o.next||e[h.type]===j[c])return d.element.attr({"data-currentview":l[c]}).addClass("ws-size-"+m.size).data("pickercontent",{data:h,content:o,values:n}),d.bodyElement.html(o.main),f(o,d,"prev"),f(o,d,"next"),f(o,d,"yearPrev"),f(o,d,"yearNext"),a(m.orig).trigger("pickerchange"),b[o.type]&&new b[o.type](d.bodyElement.children(),d,o),d.element.filter('[data-vertical="bottom"]').triggerHandler("pospopover"),!1}})}})}(),g.showPickerContent=function(a,b){var c=a.options,d=a._popoverinit;a._popoverinit=!0,d||(g.commonInit(a,b),g.commonDateInit(a,b)),b.element.triggerHandler("updatepickercontent"),!d||c.restartView?h.setYearList(c.defValue||c.value,b,a,c.startView):h[b.element.attr("data-currentview")||"setYearList"](c.defValue||c.value,b,a,0),a._popoverinit=!0},g.commonDateInit=function(c,e){if(!c._commonDateInit){c._commonDateInit=!0;var f=c.options,i=function(){return a(this).hasClass("othermonth")&&"pointer"!=a(this).css("cursor")||e.actionFn({"data-action":a.attr(this,"data-action"),value:a(this).val()||a.attr(this,"value")}),!1},j=(new Date).getTime(),l=function(d){var f=[],h="",i="";d.options=c.getOptions()||{},a("div.ws-options",e.contentElement).remove(),a.each(d.options[0],function(a,b){var e=g.isInRange(a.split("-"),d.maxS,d.minS)?"":' disabled="" ';b&&(b=' '+b+" "),f.push(''+c.formatValue(a,!1)+" "+b+" ")}),f.length&&(j++,d.options[1]&&(i="datalist-"+j,h=''+d.options[1]+" ",i=' aria-labelledbyid="'+i+'" '),new b.ListBox(a('").insertAfter(e.bodyElement)[0],e,{noFocus:!0}))},m=function(){var d;e.isDirty&&(e.isDirty=!1,d=f.max.split("T"),f.maxS=d[0].split("-"),d[1]&&f.maxS.push(d[1]),d=f.min.split("T"),f.minS=d[0].split("-"),d[1]&&f.minS.push(d[1]),a("button",e.buttonRow).each(function(){var d;a(this).hasClass("ws-empty")?(d=o.date.clear,d||(d=n[""].date.clear||"clear",b.warn("could not get clear text from form cfg"))):a(this).hasClass("ws-current")&&(d=(o[c.type]||{}).currentText,d||(d=(n[""][[c.type]]||{}).currentText||(o.date||{}).currentText||"current",b.warn("could not get currentText from form cfg for "+c.type)),k[c.type]&&"time"!=c.type&&a.prop(this,"disabled",!g.isInRange(k[c.type].split("-"),f.maxS,f.minS)||!!a(c.orig).triggerHandler("validatevalue",[{value:k[c.type],valueAsDate:new Date,isPartial:!1}]))),d&&a(this).text(d).attr({"aria-label":d})}),e.nextElement.attr({"aria-label":o.date.nextText}),e.prevElement.attr({"aria-label":o.date.prevText}),e.yearNextElement.attr({"aria-label":o.date.nextText}),e.yearPrevElement.attr({"aria-label":o.date.prevText}),e.contentElement.attr({dir:o.date.isRTL?"rtl":"ltr",lang:b.formcfg.__activeName}),l(f,f.maxS,f.minS),e.isVisible&&g.showPickerContent(c,e)),a("button.ws-empty",e.buttonRow).prop("disabled",a.prop(c.orig,"required")),e.isDirty=!1};"time"==c.type&&(f.minView=3,f.startView=3),f.minView||(f.minView=0),f.startView1&&(g=a('button[value="'+d.value+'"]',e.bodyElement),g.filter(":not(.othermonth)").length?(a("button.checked-value",e.bodyElement).removeClass("checked-value"),g.addClass("checked-value").trigger("focus"),f.updateOnInput=!1):g=!1)),h[d["data-action"]](d.value,e,c,0),c._handledValue&&(delete c._handledValue,g&&(f.updateOnInput=!0))):b.warn("no action for "+d["data-action"])},e.contentElement.html('
'),e.nextElement=a("button.ws-next",e.contentElement),e.prevElement=a("button.ws-prev",e.contentElement),e.yearNextElement=a("button.ws-super-next",e.contentElement),e.yearPrevElement=a("button.ws-super-prev",e.contentElement),e.bodyElement=a("div.ws-picker-body",e.contentElement),e.buttonRow=a("div.ws-button-row",e.contentElement),e.element.on("updatepickercontent",m),e.contentElement.wsTouchClick("button[data-action]",i).on("change","select[data-action]",i),a(f.orig).on("input",function(){var a;f.updateOnInput&&e.isVisible&&f.value&&(a=e.element.attr("data-currentview"))&&h[a](c.options.value,e,c,0)}),a(d).onTrigger("wslocalechange",c._propertyChange),null==f.updateOnInput&&(f.inlinePicker||f.noChangeDismiss)&&(f.updateOnInput=!0),f.inlinePicker&&(e.element.attr("data-class",a.prop(c.orig,"className")),e.element.attr("data-id",a.prop(c.orig,"id"))),a(f.orig).trigger("pickercreated")}}});