(function(e,j,i,b){var h="asDatepicker",c={firstDayOfWeek:0,mode:"single",displayMode:"dropdown",calendars:1,date:"today",keyboard:true,rangeSeparator:"--",multipleSeparator:",",multipleSize:5,container:"body",position:"bottom",alwaysShow:false,onceClick:false,min:null,max:null,selectableDate:[],selectableYear:[],selectableMonth:[],selectableDay:[],selectableDayOfWeek:[],lang:"zh",views:["days"],outputFormat:"yyyy-mm-dd",mobileMode:false,namespace:"calendar",tplInputWrapper:function(){return'
'},tplWrapper:function(){return'
'},tplContent:function(){return'
<
>
'},tplTitle:function(){return'
test
'},onInit:null,onReady:null,onRender:null,onChange:null,onBeforeShow:null,onShow:null,onBeforeHide:null,onHide:null};var d=e(j);var a=e(i);var f={};var g=0;var k=e[h]=function(n,m){var l=this,o=e(n).data();this.$el=e(n);this.defaultOptions=e.extend(true,{},c,m,o);this.options=e.extend(true,{},c,m,o);e.each(o,function(p,q){l.options[p]=l._parseHtmlString(p,q);l.defaultOptions[p]=l._parseHtmlString(p,q)});this.namespace=this.options.namespace;this.$inputWrap=this.$el.addClass(this.namespace+"-input").wrap(this.options.tplInputWrapper().replace(/namespace/g,this.namespace)).parent();this.$inputIcon=e('');this.$inputIcon.appendTo(this.$inputWrap);this.$container=e(this.options.container);this._trigger("init");this._init()};k.LABEL=f;k.localize=function(m,l){f[m]=l};k.localize("en",{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],buttons:["Cancel","Save"]});k.localize("zh",{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一","二","三","四","五","六","七","八","九","十","十一","十二"],buttons:["取消","确定"]});k.prototype={constructor:k,_init:function(){this.mode=this.options.mode;this.format=this._parseFormat("yyyy-mm-dd");this.outputFormat=this._parseFormat(this.options.outputFormat||"yyyy/mm/dd");this.focused=0;this.flag=g++;this.pickerHide=false;this.selected=false;this.showed=false;this.bound=false;this.hasKeyboard=this.options.keyboard;this.map={};this.views=[];this.isMobile=this.options.mobileMode;var m=this.options.tplWrapper().replace(/namespace/g,this.namespace),q=this.options.tplContent().replace(/namespace/g,this.namespace),t=this.options.tplTitle().replace(/namespace/g,this.namespace),r=f[this.options.lang].buttons;this.$picker=e(m);switch(this.mode){case"single":this.calendarsNum=1;break;case"range":this.calendarsNum=2;break;case"multiple":this.calendarsNum=this.isMobile?1:this.options.calendars;this.options.views=["days"];break}for(var p=0;p');this.$picker.append(t).addClass(this.namespace+"_isMobile");this.$picker.css({"font-size":Math.round(o*0.04)+"px"})}this.$picker.attr("tabindex","0");this._initStatus(this.options.displayMode);this._initSections();this._initDate();for(var n=0;n',o,B,l,v,y,n,x=[],u=[];E=E<0?7+E:E;for(var A=0;A<7;A++){var p=this.options.firstDayOfWeek+A>6?this.options.firstDayOfWeek+A-7:this.options.firstDayOfWeek+A;r+=""+f[this.options.lang].daysShort[p]+""}r+='
';for(var z=0;z<42;z++){C=(z-E+1);B=false;l=false;o=false;v=false;x=[o,B,l,v];y=0;n="";if(z>0&&z%7===0){r+='
'}if(z(m+E-1)){n=this.namespace+"_otherMonth";y=(C-m);u[z]=new Date(t,(D+1),y,0,0,0,0)}else{u[z]=new Date(t,D,C,0,0,0,0);y=C;if(this.hasKeyboard){if(this.mode==="multiple"){if(Date.parse(u[z])===Date.parse(this._date.focusDate)){n+=" "+this.namespace+"_focus"}}else{if(Date.parse(u[z])===Date.parse(this._date.focusDate[q])){n+=" "+this.namespace+"_focus"}}}}}x=this._judgeStatus(q,"days",this.mode,x,u[z],this._date.selectedDate);n+=this._renderStatus(x);r+=''+y+""}r+="
";return r},_generateMonths:function(s){var v=this._date.currentYear[s],r="",u,t=f[this.options.lang].monthsShort,m=[],x=this._date.focusDate[s],w,n,l,q,o=[];r+='
';for(var p=0;p<12;p++){w=false;n=false;l=false;q=false;o=[l,w,n,q];u="";if(p>0&&p%3===0){r+='
'}m[p]=new Date(v,p,1,0,0,0,0);if(this.hasKeyboard){if(Date.parse(m[p])===Date.parse(new Date(x.getFullYear(),x.getMonth(),1,0,0,0,0))){u+=" "+this.namespace+"_focus"}}o=this._judgeStatus(s,"months",this.mode,o,m[p],this._date.selectedMonthDate);u+=this._renderStatus(o);r+=''+t[p]+""}r+="
";return r},_generateYears:function(t){var w=this._date.currentYear[t],s="",v,u=0,n=[],y=this._date.focusDate[t],x,p,l,r,q=[];s+='
';for(var o=0;o<12;o++){x=false;p=false;l=false;r=false;q=[l,x,p,r];v="";u=w-7+o;if(o>0&&o%3===0){s+='
'}n[o]=new Date(u,0,1,0,0,0,0);if(this.hasKeyboard){if(Date.parse(n[o])===Date.parse(new Date(y.getFullYear(),0,1,0,0,0,0))){v+=" "+this.namespace+"_focus"}}q=this._judgeStatus(t,"years",this.mode,q,n[o],this._date.selectedYearDate);v+=this._renderStatus(q);s+=''+u+""}s+="
";return s},_judgeLock:function(l){var p=false,o=false,n,m;switch(this.mode){case"range":if(l===0){switch(this.views[l]){case"days":n=Date.parse(this._date.currentDate[l]);m=Date.parse(this._date.selectedMonthDate[1]);break;case"months":n=Date.parse(this._date.currentYearDate[l]);m=Date.parse(this._date.selectedYearDate[1]);break;case"years":n=new Date(this._date.currentYearDate[l]).setFullYear(this._date.currentYear[l]+4);m=Date.parse(this._date.selectedYearDate[1]);break}o=!this._setPoint("<",o,n,m)}else{switch(this.views[l]){case"days":n=Date.parse(this._date.currentDate[l]);m=Date.parse(this._date.selectedMonthDate[0]);break;case"months":n=Date.parse(this._date.currentYearDate[l]);m=Date.parse(this._date.selectedYearDate[0]);break;case"years":n=new Date(this._date.currentYearDate[l]).setFullYear(this._date.currentYear[l]-7);m=Date.parse(this._date.selectedYearDate[0]);break}p=!this._setPoint(">",p,n,m)}break;case"multiple":if(this.calendarsNum>1){if(l===0){o=true}else{if(l===this.calendarsNum-1){p=true}else{p=o=true}}}break}if(p===true){this.calendarPrevs.eq(l).addClass(this.namespace+"_blocked")}else{this.calendarPrevs.eq(l).removeClass(this.namespace+"_blocked")}if(o===true){this.calendarNexts.eq(l).addClass(this.namespace+"_blocked")}else{this.calendarNexts.eq(l).removeClass(this.namespace+"_blocked")}},_judgeSection:function(n,l,o){var m=true;if(no){m=false}return m},_judgeSections:function(q,m,l,p){var s=this,o=false;switch(q){case"date":if(p){m=Date.parse(m);e.each(l,function(v,u){if(!o){switch(u.length){case b:if(m===Date.parse(u)){o=true}break;case 2:o=s._judgeSection(m,Date.parse(u[0]),Date.parse(u[1]));break}}})}else{var n=Date.parse(m[0]),r=Date.parse(m[1]);e.each(l,function(v,u){if(!o){switch(u.length){case b:if(Date.parse(u)>=n&&Date.parse(u)<=r){o=true}break;case 2:o=true;if(rDate.parse(u[1])){o=false}break}}})}break;case"block":e.each(l,function(v,u){if(!o){switch(u.length){case b:if(m===u){o=true}break;case 2:o=s._judgeSection(m,u[0],u[1]);break}}});break;case"dayOfWeek":var t=m.getDay();e.each(l,function(v,u){if(!o){switch(u.length){case b:if(t===u){o=true}break;case 2:o=s._judgeSection(t,u[0],u[1]);break}}});break}return o},_judgeStatus:function(r,t,p,n,l,q){var s=n[0],m=n[1],u=n[2];s=!this._isSelectable(t,l.getFullYear(),l.getMonth(),l.getDate());switch(p){case"single":m=this._setPoint("=",m,Date.parse(l),Date.parse(q[r]));break;case"range":m=this._setPoint("=",m,Date.parse(l),Date.parse(q[r]));u=this._setSection(u,l,q[0],q[1]);if(r===0){s=this._setPoint(">",s,Date.parse(l),Date.parse(q[1]))}else{if(r===1){s=this._setPoint("<",s,Date.parse(l),Date.parse(q[0]))}}break;case"multiple":for(var o=0;o":if(l>n){o=true}break}return o},_setSection:function(n,m,l,s){var r=n,q=Date.parse(m),p=Date.parse(l),o=Date.parse(s);if(q>=p&&q<=o){r=true}return r},_isSelectable:function(x,w,o,u){var s=true,r=this._parseDate(this.options.min,this.format),z=this._parseDate(this.options.max,this.format),t=this._parseDateArr(this.options.selectableDate,this.format),B=this._parseDateSection(this.options.selectableYear),n=this._parseDateSection(this.options.selectableMonth),q=this._parseDateSection(this.options.selectableDay),l=this._parseDateSection(this.options.selectableDayOfWeek);var p,C,v,A;switch(x){case"years":p=new Date(w,0,1);C=new Date(w+1,0,0);v=[p,C];A=false;break;case"months":p=new Date(w,o,1);C=new Date(w,o+1,0);v=[p,C];A=false;break;case"days":p=C=v=new Date(w,o,u);A=true;break}if(r&&r>C){s=false}if(z&&z0){s=this._judgeSections("date",v,t,A)}if(s&&B.length>0){s=this._judgeSections("block",w,B)}if(x==="months"||x==="days"){if(s&&n.length>0){s=this._judgeSections("block",o,n)}}if(x==="days"){if(s&&q.length>0){s=this._judgeSections("block",u,q)}if(s&&l.length>0){s=this._judgeSections("dayOfWeek",new Date(w,o,u),l)}}return s},_renderStatus:function(m){var l=m[0],p=m[1],q=m[2],n=m[3],o="";if(n===true){o=" "+this.namespace+"_untouchable"}else{if(l===true){o=" "+this.namespace+"_untouchable"}if(q===true){o+=" "+this.namespace+"_inRange"}}if(p===true){o+=" "+this.namespace+"_active"}return o},_changeView:function(m,l){switch(m){case"caption":if(this.options.mode!=="multiple"){if(this.views[l]==="days"){this.views[l]="months"}else{if(this.views[l]==="months"){this.views[l]="years"}}}break;case"content":if(this.views[l]==="years"){this.views[l]="months"}else{if(this.views[l]==="months"){this.views[l]="days"}}break;case"higher":if(this.options.mode!=="multiple"){if(this.views[l]==="days"){this.views[l]="months"}else{if(this.views[l]==="months"){this.views[l]="years"}}}break;case"lower":if(this.options.mode!=="multiple"){if(this.views[l]==="years"){this.views[l]="months"}else{if(this.views[l]==="months"){this.views[l]="days"}}}break}},_setDate:function(o,n,l){if(typeof n==="object"){for(var m in n){switch(m){case"day":o.setDate(n[m]);break;case"month":o.setMonth(n[m]);break;case"year":o.setYear(n[m]);break}}}else{switch(n){case"day":o.setDate(l);break;case"month":o.setMonth(l);break;case"year":o.setYear(l);break}}},_formatDate:function(l,o){l=new Date(l);var p={d:l.getDate(),m:l.getMonth()+1,yy:l.getFullYear().toString().substring(2),yyyy:l.getFullYear()};p.dd=(p.d<10?"0":"")+p.d;p.mm=(p.m<10?"0":"")+p.m;l=[];for(var m=0,n=o.parts.length;m");if(l.length>1){l={from:l[0],to:l[1]}}else{l=l[0]}r.push(l)}return r}else{return p}},_parseFormat:function(n){var m=n.match(/[.\/\-\s].*?/),l=n.split(/\W+/)||l;if(!l||l.length===0){throw new Error("Invalid date format.")}return{separator:m,parts:l}},_parseDate:function(p,r){if(p!==null){var m=new Date(),l=m.getDate();switch(typeof(p)){case"string":if(p.length<5){m.setHours(0,0,0,0);m.setDate(l+Number(p))}else{var q=p.split(r.separator)||q,s;m.setHours(0,0,0,0);if(q.length===r.parts.length){for(var n=0,o=r.parts.length;n(n)){if(r==="bottom"){r="top"}else{if(r="left"){r="leftTop"}else{if(r="right"){r="rightTop"}}}}break;case"top":case"rightTop":case"leftTop":if(l-x<0){if(r==="top"){r="bottom"}else{if(r="leftTop"){r="left"}else{if(r="rightTop"){r="right"}}}}break}switch(r){case"top":m=u+t;w=l-x;break;case"right":m=u+s+t;w=l;break;case"bottom":m=u+t;w=l+q;break;case"left":m=u-v+t;w=l;break;case"rightTop":m=u+s+t;w=l-x+q;break;case"leftTop":m=u-v+t;w=l-x+q;break}}this.$picker.css({left:m,top:w})},_toggle:function(){if(this.showed){this.pickerHide=true;this._blur()}else{this._focus()}},_focus:function(){if(this.options.displayMode==="dropdown"&&this.showed===false){this.show()}if(this.hasKeyboard){this._keyboard.init(this)}},_blur:function(){if(this.options.displayMode==="dropdown"){if(this.pickerHide===true){this.hide();this.pickerHide=false}}if(this.hasKeyboard){this._keyboard.destroy(this)}},_trigger:function(m){var o=arguments.length>1?Array.prototype.slice.call(arguments,1).push(this):this;this.$el.trigger(h+"::"+m,o);m=m.replace(/\b\w+\b/g,function(p){return p.substring(0,1).toUpperCase()+p.substring(1)});var n="on"+m;var l=arguments.length>1?Array.prototype.slice.call(arguments,1):b;if(typeof this.options[n]==="function"){this.options[n].apply(this,l)}},_click:function(s){var l=e(s.target);if(l.closest(this.$inputIcon).length===0&&l.closest(this.$picker).length===0&&l.closest(this.$el).length===0&&this.options.alwaysShow===false){if(this.isMobile){this.mobileCancel(0)}else{this.hide()}}else{if(l.closest(this.$el).length!==1&&l.closest(this.$picker).length===1){var n=e(s.target).closest("div");var q=e(s.target).closest("span");if(n.parent("."+this.namespace+"-header").length===1){var r=n.parents("."+this.namespace+"-content").index();switch(n[0].className){case this.namespace+"-caption":this._changeView("caption",r);this._manageViews(r);break;case this.namespace+"-prev":this.prev(r);break;case this.namespace+"-next":this.next(r);break}}if(q.length===1){var p=q.parents("."+this.namespace+"-content").index();if(!q.hasClass(this.namespace+"_otherMonth")&&!q.hasClass(this.namespace+"_untouchable")&&q.parent("."+this.namespace+"-head").length!==1){this._changeValue(q,p);this._changeView("content",p);this._updateDate(p);switch(this.mode){case"single":if(this.views[p]==="days"){this.selected=true}this._manageViews(p);break;case"range":this._manageViews(0);this._manageViews(1);break;case"multiple":this._manageViews(p-1);this._manageViews(p);this._manageViews(p+1);break}if(!this.isMobile){this._setValue()}}}if(n.parent("."+this.namespace+"-buttons").length===1){var o=n.parents("."+this.namespace+"-content").index(),m=n[0].className===this.namespace+"-button-save"?true:false;if(m){this.mobileEnter(o)}else{this.mobileCancel(o)}}if(!this.isMobile){if(this.selected===true&&this.options.alwaysShow===false&&this.options.onceClick===true){this.hide()}else{if(this.options.displayMode==="dropdown"){this.$el.focus()}}}}}s.preventDefault()},_changeValue:function(q,p){var o="",l="",m=this;switch(this.views[p]){case"years":o=parseInt(q.text(),10);this._date.currentDate[p].setYear(o);break;case"months":o=Number(q.attr("class").match(/month\-([0-9]+)/)[1]);this._date.currentDate[p].setMonth(o);break;case"days":o=parseInt(q.text(),10);l=new Date(this._date.currentYear[p],this._date.currentMonth[p],o,0,0,0,0);switch(this.options.mode){case"single":case"range":this._date.selectedDate[p]=l;break;case"multiple":var n=Date.parse(l);if(e.inArray(n,this._date.selectedDate)>-1){e.each(this._date.selectedDate,function(r,s){if(s===n){m._date.selectedDate.splice(r,1)}})}else{if(this._date.selectedDate.lengthm){this._date.focusDate.setDate(m)}this._date.focusDate.setMonth(this._date.focusDate.getMonth()-1);for(var l=0;lm){this._date.focusDate[q].setDate(m)}this._date.focusDate[q]=new Date(o.getFullYear(),o.getMonth(),this._date.focusDate[q].getDate(),0,0,0,0)}}break;case"months":o.setYear(this._date.currentYear[q]-1);if(this.hasKeyboard){this._date.focusDate[q]=new Date(o.getFullYear(),this._date.focusDate[q].getMonth(),this._date.focusDate[q].getDate(),0,0,0,0)}break;case"years":o.setYear(this._date.currentYear[q]-12);if(this.hasKeyboard&&p){this._date.focusDate[q]=new Date(this._date.focusDate[q].getFullYear()-12,this._date.focusDate[q].getMonth(),this._date.focusDate[q].getDate(),0,0,0,0)}break}this._updateDate(q);this._manageViews(q)},next:function(p,o){this.touchflag=false;var n=this._date.currentDate[p];switch(this.views[p]){case"days":var q;if(this.mode==="multiple"){if(o){if(this.focused===this.calendarsNum-1){for(var m=0;mq){this._date.focusDate.setDate(q)}this._date.focusDate.setMonth(this._date.focusDate.getMonth()+1);for(var l=0;lq){this._date.focusDate[p].setDate(q)}this._date.focusDate[p]=new Date(n.getFullYear(),n.getMonth(),this._date.focusDate[p].getDate(),0,0,0,0)}}break;case"months":n.setYear(this._date.currentYear[p]+1);if(this.hasKeyboard){this._date.focusDate[p]=new Date(n.getFullYear(),this._date.focusDate[p].getMonth(),this._date.focusDate[p].getDate(),0,0,0,0)}break;case"years":n.setYear(this._date.currentYear[p]+12);if(this.hasKeyboard&&o){this._date.focusDate[p]=new Date(this._date.focusDate[p].getFullYear()+12,this._date.focusDate[p].getMonth(),this._date.focusDate[p].getDate(),0,0,0,0)}break}this._updateDate(p);this._manageViews(p)},mobilePrev:function(l){this.calendars.eq(l).removeClass(this.namespace+"_show");this.calendars.eq(l-1).addClass(this.namespace+"_show")},mobileNext:function(l){this.calendars.eq(l).removeClass(this.namespace+"_show");this.calendars.eq(l+1).addClass(this.namespace+"_show")},mobileInteDate:function(m){var l=this;if(this.mode==="multiple"){if(this._date.selectedDate.length>0){l._date.currentDate[0]=new Date(this._date.selectedDate[0])}}else{this._date.currentDate[m]=new Date(this._date.selectedDate[m])}this.views[m]="days";this._updateDate(m)},mobileEnter:function(l){if(this.mode==="range"&&l===0){this.mobileNext(l);this.views[l]="days"}else{this.mobileInteDate(l);this._setValue();this.hide()}this._manageViews(l)},mobileCancel:function(l){if(l===1){this.mobilePrev(l);this.views[l]="days"}else{this.dateTransform(this._date.cache,this._date);this.mobileInteDate(l);this.hide()}this._manageViews(l)},dateTransform:function(n,m){var l=this;m.currentDate=[];m.selectedDate=[];e.each(n.currentDate,function(p,o){m.currentDate[p]=new Date(o)});e.each(n.selectedDate,function(q,o){var p=new Date(o);m.selectedDate[q]=l.mode==="multiple"?Date.parse(p):p})},show:function(){var l=this;if(this.isMobile){this.dateTransform(this._date,this._date.cache)}if(this.options.displayMode==="inline"){this._trigger("beforeShow");this.$picker.on("mouseDown."+this.flag,function(n){l._prevent(n)});this.$picker.on("click."+this.flag,function(n){l._click.call(l,n)})}else{if(this.showed===false){this._trigger("beforeShow");this.$inputWrap.addClass(this.namespace+"_active");this.$picker.addClass(this.namespace+"_show");if(this.isMobile){this.calendars.eq(0).addClass(this.namespace+"_show");if(this.mode==="range"){this.calendars.eq(1).removeClass(this.namespace+"_show")}e("body").append(this.$cover).css("overflow","hidden");d.on("scrollstart."+this.flag,function(n){n.preventDefault()});d.on("tap."+this.flag,function(n){l._click.call(l,n)});var m=function(p){var o=p.swipestart.coords[0],n=p.swipestop.coords[0];if(n>o){l.prev.call(l,0)}else{if(nthis._date.currentYear[m]+1){if(!n){l.setFullYear(l.getFullYear()+3);this.next(m)}}else{l.setFullYear(l.getFullYear()+3);this._manageViews(m)}break}},prevPage:function(){if(this.mode==="multiple"){this.prev(this.focused)}else{if(!this.calendarPrevs.eq(this.focused).hasClass(this.namespace+"_blocked")){this.prev(this.focused,true)}}},nextPage:function(){if(this.mode==="multiple"){this.next(this.focused)}else{if(!this.calendarNexts.eq(this.focused).hasClass(this.namespace+"_blocked")){this.next(this.focused,true)}}},higherView:function(){if(this.mode!=="multiple"){var l=this.focused;this._changeView("higher",l);this._manageViews(l)}},prevCalendar:function(){if(this.mode!=="multiple"){var l=this.calendars.length;if(--this.focused<0){this.focused=l}}},nextCalendar:function(){if(this.mode!=="multiple"){var l=this.calendars.length;if(++this.focused>=l){this.focused=0}}},updateValue:function(m){var o=m.focused,n=m.mode==="multiple"?m._date.focusDate:m._date.focusDate[o];if(!m.calendars.eq(o).find("."+m.namespace+"_focus").hasClass(m.namespace+"_untouchable")){switch(m.views[o]){case"days":switch(m.options.mode){case"single":case"range":m._date.selectedDate[o]=new Date(n);break;case"multiple":var l=Date.parse(new Date(n));if(e.inArray(l,m._date.selectedDate)>-1){e.each(m._date.selectedDate,function(p,q){if(q===l){m._date.selectedDate.splice(p,1);return false}})}else{m._date.selectedDate.push(l)}break}break;case"months":m._date.currentDate[o].setMonth(n.getMonth());m.views[o]="days";break;case"years":m._date.currentDate[o].setFullYear(n.getFullYear());m.views[o]="months";break}m._updateDate(o);if(m.mode==="range"){m._manageViews(0);m._manageViews(1)}else{if(m.mode==="multiple"){m._manageViews(o-1);m._manageViews(o);m._manageViews(o+1)}else{m._manageViews(o)}}m._setValue()}},enter:function(){var n=this.$el.val(),w=this,t;if(n===this.oldValue||this.oldValue===""){this._keyboard.updateValue(this)}else{var q;switch(this.mode){case"single":var x=Date.parse(n);if(x){this._date.selectedDate[0]=new Date(x);this._date.currentDate[0]=new Date(this._date.selectedDate[0]);this._updateDate(0);this._manageViews(0)}break;case"range":q=this._stringSeparate(n,this.options.rangeSeparator);var u=Date.parse(q[0]),v=Date.parse(q[1]);if(q.length===2){t=true;if(u&&v){if(u>v){t=false}}else{t=false}}else{t=false}if(t===true){this._date.selectedDate[0]=new Date(u);this._date.selectedDate[1]=new Date(v);for(var r=0;r<2;r++){this._date.currentDate[r]=new Date(this._date.selectedDate[r]);this._updateDate(r);this._manageViews(r)}}else{this._keyboard.updateValue(this)}break;case"multiple":q=this._stringSeparate(n,this.options.multipleSeparator);var s=[];t=true;for(var p=0;p-1){e.each(this._date.selectedDate,function(m,y){if(y===s[o]){w._date.selectedDate.splice(m,1)}})}else{this._date.selectedDate.push(s[o])}}for(var l=0;l