PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-content
/
plugins
/
webon-core
/
assets
/
plugins
/
datepick
/*! http://keith-wood.name/datepick.html Date picker for jQuery v5.1.1. Written by Keith Wood (wood.keith{at}optusnet.com.au) February 2010. Licensed under the MIT (http://keith-wood.name/licence.html) licence. Please attribute the author if you use it. */ !function(a){"use strict";var b="datepick";a.JQPlugin.createPlugin({name:b,defaultRenderer:{picker:'<div class="datepick"><div class="datepick-nav">{link:prev}{link:today}{link:next}</div>{months}{popup:start}<div class="datepick-ctrl">{link:clear}{link:close}</div>{popup:end}<div class="datepick-clear-fix"></div></div>',monthRow:'<div class="datepick-month-row">{months}</div>',month:'<div class="datepick-month"><div class="datepick-month-header">{monthHeader}</div><table><thead>{weekHeader}</thead><tbody>{weeks}</tbody></table></div>',weekHeader:"<tr>{days}</tr>",dayHeader:"<th>{day}</th>",week:"<tr>{days}</tr>",day:"<td>{day}</td>",monthSelector:".datepick-month",daySelector:"td",rtlClass:"datepick-rtl",multiClass:"datepick-multi",defaultClass:"",selectedClass:"datepick-selected",highlightedClass:"datepick-highlight",todayClass:"datepick-today",otherMonthClass:"datepick-other-month",weekendClass:"datepick-weekend",commandClass:"datepick-cmd",commandButtonClass:"",commandLinkClass:"",disabledClass:"datepick-disabled"},commands:{prev:{text:"prevText",status:"prevStatus",keystroke:{keyCode:33},enabled:function(a){var b=a.curMinDate();return!b||c.add(c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),1-a.options.monthsToStep,"m"),a),1),-1,"d").getTime()>=b.getTime()},date:function(a){return c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),-a.options.monthsToStep,"m"),a),1)},action:function(a){c.changeMonth(this,-a.options.monthsToStep)}},prevJump:{text:"prevJumpText",status:"prevJumpStatus",keystroke:{keyCode:33,ctrlKey:!0},enabled:function(a){var b=a.curMinDate();return!b||c.add(c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),1-a.options.monthsToJump,"m"),a),1),-1,"d").getTime()>=b.getTime()},date:function(a){return c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),-a.options.monthsToJump,"m"),a),1)},action:function(a){c.changeMonth(this,-a.options.monthsToJump)}},next:{text:"nextText",status:"nextStatus",keystroke:{keyCode:34},enabled:function(a){var b=a.get("maxDate");return!b||c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),a.options.monthsToStep,"m"),a),1).getTime()<=b.getTime()},date:function(a){return c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),a.options.monthsToStep,"m"),a),1)},action:function(a){c.changeMonth(this,a.options.monthsToStep)}},nextJump:{text:"nextJumpText",status:"nextJumpStatus",keystroke:{keyCode:34,ctrlKey:!0},enabled:function(a){var b=a.get("maxDate");return!b||c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),a.options.monthsToJump,"m"),a),1).getTime()<=b.getTime()},date:function(a){return c.day(c._applyMonthsOffset(c.add(c.newDate(a.drawDate),a.options.monthsToJump,"m"),a),1)},action:function(a){c.changeMonth(this,a.options.monthsToJump)}},current:{text:"currentText",status:"currentStatus",keystroke:{keyCode:36,ctrlKey:!0},enabled:function(a){var b=a.curMinDate(),d=a.get("maxDate"),e=a.selectedDates[0]||c.today();return(!b||e.getTime()>=b.getTime())&&(!d||e.getTime()<=d.getTime())},date:function(a){return a.selectedDates[0]||c.today()},action:function(a){var b=a.selectedDates[0]||c.today();c.showMonth(this,b.getFullYear(),b.getMonth()+1)}},today:{text:"todayText",status:"todayStatus",keystroke:{keyCode:36,ctrlKey:!0},enabled:function(a){var b=a.curMinDate(),d=a.get("maxDate");return(!b||c.today().getTime()>=b.getTime())&&(!d||c.today().getTime()<=d.getTime())},date:function(){return c.today()},action:function(){c.showMonth(this)}},clear:{text:"clearText",status:"clearStatus",keystroke:{keyCode:35,ctrlKey:!0},enabled:function(){return!0},date:function(){return null},action:function(){c.clear(this)}},close:{text:"closeText",status:"closeStatus",keystroke:{keyCode:27},enabled:function(){return!0},date:function(){return null},action:function(){c.hide(this)}},prevWeek:{text:"prevWeekText",status:"prevWeekStatus",keystroke:{keyCode:38,ctrlKey:!0},enabled:function(a){var b=a.curMinDate();return!b||c.add(c.newDate(a.drawDate),-7,"d").getTime()>=b.getTime()},date:function(a){return c.add(c.newDate(a.drawDate),-7,"d")},action:function(){c.changeDay(this,-7)}},prevDay:{text:"prevDayText",status:"prevDayStatus",keystroke:{keyCode:37,ctrlKey:!0},enabled:function(a){var b=a.curMinDate();return!b||c.add(c.newDate(a.drawDate),-1,"d").getTime()>=b.getTime()},date:function(a){return c.add(c.newDate(a.drawDate),-1,"d")},action:function(){c.changeDay(this,-1)}},nextDay:{text:"nextDayText",status:"nextDayStatus",keystroke:{keyCode:39,ctrlKey:!0},enabled:function(a){var b=a.get("maxDate");return!b||c.add(c.newDate(a.drawDate),1,"d").getTime()<=b.getTime()},date:function(a){return c.add(c.newDate(a.drawDate),1,"d")},action:function(){c.changeDay(this,1)}},nextWeek:{text:"nextWeekText",status:"nextWeekStatus",keystroke:{keyCode:40,ctrlKey:!0},enabled:function(a){var b=a.get("maxDate");return!b||c.add(c.newDate(a.drawDate),7,"d").getTime()<=b.getTime()},date:function(a){return c.add(c.newDate(a.drawDate),7,"d")},action:function(){c.changeDay(this,7)}}},defaultOptions:{pickerClass:"",showOnFocus:!0,showTrigger:null,showAnim:"show",showOptions:{},showSpeed:"normal",popupContainer:null,alignment:"bottom",fixedWeeks:!1,firstDay:0,calculateWeek:null,monthsToShow:1,monthsOffset:0,monthsToStep:1,monthsToJump:12,useMouseWheel:!0,changeMonth:!0,yearRange:"c-10:c+10",shortYearCutoff:"+10",showOtherMonths:!1,selectOtherMonths:!1,defaultDate:null,selectDefaultDate:!1,minDate:null,maxDate:null,dateFormat:"mm/dd/yyyy",autoSize:!1,rangeSelect:!1,rangeSeparator:" - ",multiSelect:0,multiSeparator:",",onDate:null,onShow:null,onChangeMonthYear:null,onSelect:null,onClose:null,altField:null,altFormat:null,constrainInput:!0,commandsAsDateFormat:!1,commands:{}},regionalOptions:{"":{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yyyy",firstDay:0,renderer:{},prevText:"<Prev",prevStatus:"Show the previous month",prevJumpText:"<<",prevJumpStatus:"Show the previous year",nextText:"Next>",nextStatus:"Show the next month",nextJumpText:">>",nextJumpStatus:"Show the next year",currentText:"Current",currentStatus:"Show the current month",todayText:"Today",todayStatus:"Show today's month",clearText:"Clear",clearStatus:"Clear all the dates",closeText:"Close",closeStatus:"Close the datepicker",yearStatus:"Change the year",earlierText:"  ▲",laterText:"  ▼",monthStatus:"Change the month",weekText:"Wk",weekStatus:"Week of the year",dayStatus:"Select DD, M d, yyyy",defaultStatus:"Select a date",isRTL:!1}},_disabled:[],_popupClass:b+"-popup",_triggerClass:b+"-trigger",_disableClass:b+"-disable",_monthYearClass:b+"-month-year",_curMonthClass:b+"-month-",_anyYearClass:b+"-any-year",_curDoWClass:b+"-dow-",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,_msPerDay:864e5,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(a,b,c){if("string"!=typeof a&&(c=b,b=a,a=""),!b)return"";a=a||this.defaultOptions.dateFormat,c=c||{};for(var d=c.dayNamesShort||this.defaultOptions.dayNamesShort,e=c.dayNames||this.defaultOptions.dayNames,f=c.monthNamesShort||this.defaultOptions.monthNamesShort,g=c.monthNames||this.defaultOptions.monthNames,h=c.calculateWeek||this.defaultOptions.calculateWeek,i=function(b,c){for(var d=1;n+d<a.length&&a.charAt(n+d)===b;)d++;return n+=d-1,Math.floor(d/(c||1))>1},j=function(a,b,c,d){var e=""+b;if(i(a,d))for(;e.length<c;)e="0"+e;return e},k=function(a,b,c,d){return i(a)?d[b]:c[b]},l="",m=!1,n=0;n<a.length;n++)if(m)"'"!==a.charAt(n)||i("'")?l+=a.charAt(n):m=!1;else switch(a.charAt(n)){case"d":l+=j("d",b.getDate(),2);break;case"D":l+=k("D",b.getDay(),d,e);break;case"o":l+=j("o",this.dayOfYear(b),3);break;case"w":l+=j("w",h(b),2);break;case"m":l+=j("m",b.getMonth()+1,2);break;case"M":l+=k("M",b.getMonth(),f,g);break;case"y":l+=i("y",2)?b.getFullYear():(b.getFullYear()%100<10?"0":"")+b.getFullYear()%100;break;case"@":l+=Math.floor(b.getTime()/1e3);break;case"!":l+=1e4*b.getTime()+this._ticksTo1970;break;case"'":i("'")?l+="'":m=!0;break;default:l+=a.charAt(n)}return l},parseDate:function(a,b,c){if("undefined"==typeof b||null===b)throw"Invalid arguments";if(b="object"==typeof b?b.toString():b+"",""===b)return null;a=a||this.defaultOptions.dateFormat,c=c||{};var d=c.shortYearCutoff||this.defaultOptions.shortYearCutoff;d="string"!=typeof d?d:this.today().getFullYear()%100+parseInt(d,10);for(var e=c.dayNamesShort||this.defaultOptions.dayNamesShort,f=c.dayNames||this.defaultOptions.dayNames,g=c.monthNamesShort||this.defaultOptions.monthNamesShort,h=c.monthNames||this.defaultOptions.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=!1,o=null,p=function(b,c){for(var d=1;u+d<a.length&&a.charAt(u+d)===b;)d++;return u+=d-1,Math.floor(d/(c||1))>1},q=function(a,c){var d=p(a,c),e=[2,3,d?4:2,11,20]["oy@!".indexOf(a)+1],f=new RegExp("^-?\\d{1,"+e+"}"),g=b.substring(t).match(f);if(!g)throw"Missing number at position {0}".replace(/\{0\}/,t);return t+=g[0].length,parseInt(g[0],10)},r=function(a,c,d,e){for(var f=p(a,e)?d:c,g=0;g<f.length;g++)if(b.substr(t,f[g].length).toLowerCase()===f[g].toLowerCase())return t+=f[g].length,g+1;throw"Unknown name at position {0}".replace(/\{0\}/,t)},s=function(){if(b.charAt(t)!==a.charAt(u))throw"Unexpected literal at position {0}".replace(/\{0\}/,t);t++},t=0,u=0;u<a.length;u++)if(n)"'"!==a.charAt(u)||p("'")?s():n=!1;else switch(a.charAt(u)){case"d":k=q("d");break;case"D":r("D",e,f);break;case"o":l=q("o");break;case"w":q("w");break;case"m":j=q("m");break;case"M":j=r("M",g,h);break;case"y":var v=u;m=!p("y",2),u=v,i=q("y",2);break;case"@":o=this._normaliseDate(new Date(1e3*q("@"))),i=o.getFullYear(),j=o.getMonth()+1,k=o.getDate();break;case"!":o=this._normaliseDate(new Date((q("!")-this._ticksTo1970)/1e4)),i=o.getFullYear(),j=o.getMonth()+1,k=o.getDate();break;case"*":t=b.length;break;case"'":p("'")?s():n=!0;break;default:s()}if(t<b.length)throw"Additional text found at end";if(i===-1?i=this.today().getFullYear():i<100&&m&&(i+=d===-1?1900:this.today().getFullYear()-this.today().getFullYear()%100-(i<=d?0:100)),l>-1){j=1,k=l;for(var w=this.daysInMonth(i,j);k>w;w=this.daysInMonth(i,j))j++,k-=w}if(o=this.newDate(i,j,k),o.getFullYear()!==i||o.getMonth()+1!==j||o.getDate()!==k)throw"Invalid date";return o},determineDate:function(a,b,d,e,f){d&&"object"!=typeof d&&(f=e,e=d,d=null),"string"!=typeof e&&(f=e,e="");var g=function(a){try{return c.parseDate(e,a,f)}catch(a){}a=a.toLowerCase();for(var b=(a.match(/^c/)&&d?c.newDate(d):null)||c.today(),g=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,h=null;h=g.exec(a);)b=c.add(b,parseInt(h[1],10),h[2]||"d");return b};return b=b?c.newDate(b):null,a="undefined"==typeof a?b:"string"==typeof a?g(a):"number"==typeof a?isNaN(a)||a===1/0||a===-(1/0)?b:c.add(c.today(),a,"d"):c.newDate(a)},daysInMonth:function(a,b){return b=a.getFullYear?a.getMonth()+1:b,a=a.getFullYear?a.getFullYear():a,this.newDate(a,b+1,0).getDate()},dayOfYear:function(a,b,d){var e=a.getFullYear?a:c.newDate(a,b,d),f=c.newDate(e.getFullYear(),1,1);return Math.floor((e.getTime()-f.getTime())/c._msPerDay)+1},iso8601Week:function(a,b,d){var e=a.getFullYear?new Date(a.getTime()):c.newDate(a,b,d);e.setDate(e.getDate()+4-(e.getDay()||7));var f=e.getTime();return e.setMonth(0,1),Math.floor(Math.round((f-e)/c._msPerDay)/7)+1},today:function(){return this._normaliseDate(new Date)},newDate:function(a,b,c){return a?a.getFullYear?this._normaliseDate(new Date(a.getTime())):new Date(a,b-1,c,12):null},_normaliseDate:function(a){return a&&a.setHours(12,0,0,0),a},year:function(a,b){return a.setFullYear(b),this._normaliseDate(a)},month:function(a,b){return a.setMonth(b-1),this._normaliseDate(a)},day:function(a,b){return a.setDate(b),this._normaliseDate(a)},add:function(a,b,d){if("d"===d||"w"===d)this._normaliseDate(a),a.setDate(a.getDate()+b*("w"===d?7:1));else{var e=a.getFullYear()+("y"===d?b:0),f=a.getMonth()+("m"===d?b:0);a.setTime(c.newDate(e,f+1,Math.min(a.getDate(),this.daysInMonth(e,f+1))).getTime())}return a},_applyMonthsOffset:function(b,d){var e=d.options.monthsOffset;return a.isFunction(e)&&(e=e.apply(d.elem[0],[b])),c.add(b,-e,"m")},_init:function(){this.defaultOptions.commands=this.commands,this.defaultOptions.calculateWeek=this.iso8601Week,this.regionalOptions[""].renderer=this.defaultRenderer,this._super()},_instSettings:function(b){return{selectedDates:[],drawDate:null,pickingRange:!1,inline:a.inArray(b[0].nodeName.toLowerCase(),["div","span"])>-1,get:function(b){return a.inArray(b,["defaultDate","minDate","maxDate"])>-1?c.determineDate(this.options[b],null,this.selectedDates[0],this.options.dateFormat,this.getConfig()):this.options[b]},curMinDate:function(){return this.pickingRange?this.selectedDates[0]:this.get("minDate")},getConfig:function(){return{dayNamesShort:this.options.dayNamesShort,dayNames:this.options.dayNames,monthNamesShort:this.options.monthNamesShort,monthNames:this.options.monthNames,calculateWeek:this.options.calculateWeek,shortYearCutoff:this.options.shortYearCutoff}}}},_postAttach:function(b,d){d.inline?(d.drawDate=c._checkMinMax(c.newDate(d.selectedDates[0]||d.get("defaultDate")||c.today()),d),d.prevDate=c.newDate(d.drawDate),this._update(b[0]),a.fn.mousewheel&&b.mousewheel(this._doMouseWheel)):(this._attachments(b,d),b.on("keydown."+d.name,this._keyDown).on("keypress."+d.name,this._keyPress).on("keyup."+d.name,this._keyUp),b.attr("disabled")&&this.disable(b[0]))},_optionsChanged:function(b,d,e){if(e.calendar&&e.calendar!==d.options.calendar){var f=function(a){return"object"==typeof d.options[a]?null:d.options[a]};e=a.extend({defaultDate:f("defaultDate"),minDate:f("minDate"),maxDate:f("maxDate")},e),d.selectedDates=[],d.drawDate=null}var g=d.selectedDates;a.extend(d.options,e),this.setDate(b[0],g,null,!1,!0),d.pickingRange=!1,d.drawDate=c.newDate(this._checkMinMax((d.options.defaultDate?d.get("defaultDate"):d.drawDate)||d.get("defaultDate")||c.today(),d)),d.inline||this._attachments(b,d),(d.inline||d.div)&&this._update(b[0])},_attachments:function(b,d){b.off("focus."+d.name),d.options.showOnFocus&&b.on("focus."+d.name,this.show),d.trigger&&d.trigger.remove();var e=d.options.showTrigger;d.trigger=e?a(e).clone().removeAttr("id").addClass(this._triggerClass)[d.options.isRTL?"insertBefore":"insertAfter"](b).click(function(){c.isDisabled(b[0])||c[c.curInst===d?"hide":"show"](b[0])}):a([]),this._autoSize(b,d);var f=this._extractDates(d,b.val());f&&this.setDate(b[0],f,null,!0);var g=d.get("defaultDate");d.options.selectDefaultDate&&g&&0===d.selectedDates.length&&this.setDate(b[0],c.newDate(g||c.today()))},_autoSize:function(a,b){if(b.options.autoSize&&!b.inline){var d=c.newDate(2009,10,20),e=b.options.dateFormat;if(e.match(/[DM]/)){var f=function(a){for(var b=0,c=0,d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};d.setMonth(f(b.options[e.match(/MM/)?"monthNames":"monthNamesShort"])),d.setDate(f(b.options[e.match(/DD/)?"dayNames":"dayNamesShort"])+20-d.getDay())}b.elem.attr("size",c.formatDate(e,d,b.getConfig()).length)}},_preDestroy:function(b,c){c.trigger&&c.trigger.remove(),b.empty().off("."+c.name),c.inline&&a.fn.mousewheel&&b.unmousewheel(),!c.inline&&c.options.autoSize&&b.removeAttr("size")},multipleEvents:function(){var a=arguments;return function(){for(var b=0;b<a.length;b++)a[b].apply(this,arguments)}},enable:function(b){if(b=a(b),b.hasClass(this._getMarker())){var c=this._getInst(b);c.inline?b.children("."+this._disableClass).remove().end().find("button,select").prop("disabled",!1).end().find("a").attr("href","#"):(b.prop("disabled",!1),c.trigger.filter("button."+this._triggerClass).prop("disabled",!1).end().filter("img."+this._triggerClass).css({opacity:"1.0",cursor:""})),this._disabled=a.map(this._disabled,function(a){return a===b[0]?null:a})}},disable:function(b){if(b=a(b),b.hasClass(this._getMarker())){var c=this._getInst(b);if(c.inline){var d=b.children(":last"),e=d.offset(),f={left:0,top:0};d.parents().each(function(){if("relative"===a(this).css("position"))return f=a(this).offset(),!1});var g=b.css("zIndex");g=("auto"===g?0:parseInt(g,10))+1,b.prepend('<div class="'+this._disableClass+'" style="width: '+d.outerWidth()+"px; height: "+d.outerHeight()+"px; left: "+(e.left-f.left)+"px; top: "+(e.top-f.top)+"px; z-index: "+g+'"></div>').find("button,select").prop("disabled",!0).end().find("a").removeAttr("href")}else b.prop("disabled",!0),c.trigger.filter("button."+this._triggerClass).prop("disabled",!0).end().filter("img."+this._triggerClass).css({opacity:"0.5",cursor:"default"});this._disabled=a.map(this._disabled,function(a){return a===b[0]?null:a}),this._disabled.push(b[0])}},isDisabled:function(b){return b&&a.inArray(b,this._disabled)>-1},show:function(b){b=a(b.target||b);var d=c._getInst(b);if(c.curInst!==d&&(c.curInst&&c.hide(c.curInst,!0),!a.isEmptyObject(d))){d.lastVal=null,d.selectedDates=c._extractDates(d,b.val()),d.pickingRange=!1,d.drawDate=c._checkMinMax(c.newDate(d.selectedDates[0]||d.get("defaultDate")||c.today()),d),d.prevDate=c.newDate(d.drawDate),c.curInst=d,c._update(b[0],!0);var e=c._checkOffset(d);d.div.css({left:e.left,top:e.top});var f=d.options.showAnim,g=d.options.showSpeed;if(g="normal"===g&&a.ui&&parseInt(a.ui.version.substring(2))>=8?"_default":g,a.effects&&(a.effects[f]||a.effects.effect&&a.effects.effect[f])){var h=d.div.data();for(var i in h)i.match(/^ec\.storage\./)&&(h[i]=d._mainDiv.css(i.replace(/ec\.storage\./,"")));d.div.data(h).show(f,d.options.showOptions,g)}else d.div[f||"show"](f?g:0)}},_extractDates:function(a,b){if(b!==a.lastVal){a.lastVal=b,b=b.split(a.options.multiSelect?a.options.multiSeparator:a.options.rangeSelect?a.options.rangeSeparator:"\0");for(var d=[],e=0;e<b.length;e++)try{var f=c.parseDate(a.options.dateFormat,b[e],a.getConfig());if(f){for(var g=!1,h=0;h<d.length;h++)if(d[h].getTime()===f.getTime()){g=!0;break}g||d.push(f)}}catch(a){}return d.splice(a.options.multiSelect||(a.options.rangeSelect?2:1),d.length),a.options.rangeSelect&&1===d.length&&(d[1]=d[0]),d}},_update:function(b,d){b=a(b.target||b);var e=c._getInst(b);if(!a.isEmptyObject(e))if((e.inline||c.curInst===e)&&(!a.isFunction(e.options.onChangeMonthYear)||e.prevDate&&e.prevDate.getFullYear()===e.drawDate.getFullYear()&&e.prevDate.getMonth()===e.drawDate.getMonth()||e.options.onChangeMonthYear.apply(b[0],[e.drawDate.getFullYear(),e.drawDate.getMonth()+1])),e.inline){var f=a("a, :input",b).index(a(":focus",b));b.html(this._generateContent(b[0],e));var g=b.find("a, :input");g.eq(Math.max(Math.min(f,g.length-1),0)).focus()}else c.curInst===e&&(e.div||(e.div=a("<div></div>").addClass(this._popupClass).css({display:d?"none":"static",position:"absolute",left:b.offset().left,top:b.offset().top+b.outerHeight()}).appendTo(a(e.options.popupContainer||"body")),a.fn.mousewheel&&e.div.mousewheel(this._doMouseWheel)),e.div.html(this._generateContent(b[0],e)),b.focus())},_updateInput:function(b,d){var e=this._getInst(b);if(!a.isEmptyObject(e)){for(var f="",g="",h=e.options.multiSelect?e.options.multiSeparator:e.options.rangeSeparator,i=e.options.altFormat||e.options.dateFormat,j=0;j<e.selectedDates.length;j++)f+=d?"":(j>0?h:"")+c.formatDate(e.options.dateFormat,e.selectedDates[j],e.getConfig()),g+=(j>0?h:"")+c.formatDate(i,e.selectedDates[j],e.getConfig());e.inline||d||a(b).val(f),a(e.options.altField).val(g),!a.isFunction(e.options.onSelect)||d||e.inSelect||(e.inSelect=!0,e.options.onSelect.apply(b,[e.selectedDates]),e.inSelect=!1)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:3,thick:5}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(b){var c=b.elem.is(":hidden")&&b.trigger?b.trigger:b.elem,d=c.offset(),e=a(window).width(),f=a(window).height();if(0===e)return d;var g=!1;a(b.elem).parents().each(function(){return g=g||"fixed"===a(this).css("position"),!g});var h=document.documentElement.scrollLeft||document.body.scrollLeft,i=document.documentElement.scrollTop||document.body.scrollTop,j=d.top-(g?i:0)-b.div.outerHeight(),k=d.top-(g?i:0)+c.outerHeight(),l=d.left-(g?h:0),m=d.left-(g?h:0)+c.outerWidth()-b.div.outerWidth(),n=d.left-h+b.div.outerWidth()>e,o=d.top-i+b.elem.outerHeight()+b.div.outerHeight()>f;b.div.css("position",g?"fixed":"absolute");var p=b.options.alignment;return d="topLeft"===p?{left:l,top:j}:"topRight"===p?{left:m,top:j}:"bottomLeft"===p?{left:l,top:k}:"bottomRight"===p?{left:m,top:k}:"top"===p?{left:b.options.isRTL||n?m:l,top:j}:{left:b.options.isRTL||n?m:l,top:o?j:k},d.left=Math.max(g?0:h,d.left),d.top=Math.max(g?0:i,d.top),d},_checkExternalClick:function(b){if(c.curInst){var d=a(b.target);0!==d.closest("."+c._popupClass+",."+c._triggerClass).length||d.hasClass(c._getMarker())||c.hide(c.curInst)}},hide:function(b,d){if(b){var e=this._getInst(b);if(a.isEmptyObject(e)&&(e=b),e&&e===c.curInst){var f=d?"":e.options.showAnim,g=e.options.showSpeed;g="normal"===g&&a.ui&&parseInt(a.ui.version.substring(2))>=8?"_default":g;var h=function(){e.div&&(e.div.remove(),e.div=null,c.curInst=null,a.isFunction(e.options.onClose)&&e.options.onClose.apply(b,[e.selectedDates]))};if(e.div.stop(),a.effects&&(a.effects[f]||a.effects.effect&&a.effects.effect[f]))e.div.hide(f,e.options.showOptions,g,h);else{var i="slideDown"===f?"slideUp":"fadeIn"===f?"fadeOut":"hide";e.div[i](f?g:"",h)}f||h()}}},_keyDown:function(b){var d=b.data&&b.data.elem||b.target,e=c._getInst(d),f=!1,g=null;if(e.inline||e.div){if(9===b.keyCode)c.hide(d);else if(13===b.keyCode)c.selectDate(d,a("a."+e.options.renderer.highlightedClass,e.div)[0]),f=!0;else for(var h in e.options.commands)if(e.options.commands.hasOwnProperty(h)&&(g=e.options.commands[h],g.keystroke.keyCode===b.keyCode&&!!g.keystroke.ctrlKey==!(!b.ctrlKey&&!b.metaKey)&&!!g.keystroke.altKey===b.altKey&&!!g.keystroke.shiftKey===b.shiftKey)){c.performAction(d,h),f=!0;break}}else g=e.options.commands.current,g.keystroke.keyCode===b.keyCode&&!!g.keystroke.ctrlKey==!(!b.ctrlKey&&!b.metaKey)&&!!g.keystroke.altKey===b.altKey&&!!g.keystroke.shiftKey===b.shiftKey&&(c.show(d),f=!0);return e.ctrlKey=b.keyCode<48&&32!==b.keyCode||b.ctrlKey||b.metaKey,f&&(b.preventDefault(),b.stopPropagation()),!f},_keyPress:function(b){var d=c._getInst(b.data&&b.data.elem||b.target);if(!a.isEmptyObject(d)&&d.options.constrainInput){var e=String.fromCharCode(b.keyCode||b.charCode),f=c._allowedChars(d);return b.metaKey||d.ctrlKey||e<" "||!f||f.indexOf(e)>-1}return!0},_allowedChars:function(a){for(var b=a.options.multiSelect?a.options.multiSeparator:a.options.rangeSelect?a.options.rangeSeparator:"",c=!1,d=!1,e=a.options.dateFormat,f=0;f<e.length;f++){var g=e.charAt(f);if(c)"'"===g&&"'"!==e.charAt(f+1)?c=!1:b+=g;else switch(g){case"d":case"m":case"o":case"w":b+=d?"":"0123456789",d=!0;break;case"y":case"@":case"!":b+=(d?"":"0123456789")+"-",d=!0;break;case"J":b+=(d?"":"0123456789")+"-.",d=!0;break;case"D":case"M":case"Y":return null;case"'":"'"===e.charAt(f+1)?b+="'":c=!0;break;default:b+=g}}return b},_keyUp:function(b){var d=b.data&&b.data.elem||b.target,e=c._getInst(d);if(!a.isEmptyObject(e)&&!e.ctrlKey&&e.lastVal!==e.elem.val())try{var f=c._extractDates(e,e.elem.val());f.length>0&&c.setDate(d,f,null,!0)}catch(a){}return!0},_doMouseWheel:function(b,d){var e=c.curInst&&c.curInst.elem[0]||a(b.target).closest("."+c._getMarker())[0];if(!c.isDisabled(e)){var f=c._getInst(e);f.options.useMouseWheel&&(d=d<0?-1:1,c.changeMonth(e,-f.options[b.ctrlKey?"monthsToJump":"monthsToStep"]*d)),b.preventDefault()}},clear:function(b){var d=this._getInst(b);if(!a.isEmptyObject(d)){d.selectedDates=[],this.hide(b);var e=d.get("defaultDate");d.options.selectDefaultDate&&e?this.setDate(b,c.newDate(e||c.today())):this._updateInput(b)}},getDate:function(b){var c=this._getInst(b);return a.isEmptyObject(c)?[]:c.selectedDates},setDate:function(b,d,e,f,g){var h=this._getInst(b);if(!a.isEmptyObject(h)){a.isArray(d)||(d=[d],e&&d.push(e));var i=h.get("minDate"),j=h.get("maxDate"),k=h.selectedDates[0];h.selectedDates=[];for(var l=0;l<d.length;l++){var m=c.determineDate(d[l],null,k,h.options.dateFormat,h.getConfig());if(m&&(!i||m.getTime()>=i.getTime())&&(!j||m.getTime()<=j.getTime())){for(var n=!1,o=0;o<h.selectedDates.length;o++)if(h.selectedDates[o].getTime()===m.getTime()){n=!0;break}n||h.selectedDates.push(m)}}if(h.selectedDates.splice(h.options.multiSelect||(h.options.rangeSelect?2:1),h.selectedDates.length),h.options.rangeSelect){switch(h.selectedDates.length){case 1:h.selectedDates[1]=h.selectedDates[0];break;case 2:h.selectedDates[1]=h.selectedDates[0].getTime()>h.selectedDates[1].getTime()?h.selectedDates[0]:h.selectedDates[1]}h.pickingRange=!1}h.prevDate=h.drawDate?c.newDate(h.drawDate):null,h.drawDate=this._checkMinMax(c.newDate(h.selectedDates[0]||h.get("defaultDate")||c.today()),h),g||(this._update(b),this._updateInput(b,f))}},isSelectable:function(b,d){var e=this._getInst(b);return!a.isEmptyObject(e)&&(d=c.determineDate(d,e.selectedDates[0]||this.today(),null,e.options.dateFormat,e.getConfig()),this._isSelectable(b,d,e.options.onDate,e.get("minDate"),e.get("maxDate")))},_isSelectable:function(b,c,d,e,f){var g="boolean"==typeof d?{selectable:d}:a.isFunction(d)?d.apply(b,[c,!0]):{};return g.selectable!==!1&&(!e||c.getTime()>=e.getTime())&&(!f||c.getTime()<=f.getTime())},performAction:function(b,c){var d=this._getInst(b);if(!a.isEmptyObject(d)&&!this.isDisabled(b)){var e=d.options.commands;e[c]&&e[c].enabled.apply(b,[d])&&e[c].action.apply(b,[d])}},showMonth:function(b,d,e,f){var g=this._getInst(b);if(!a.isEmptyObject(g)&&("undefined"!=typeof f||g.drawDate.getFullYear()!==d||g.drawDate.getMonth()+1!==e)){g.prevDate=c.newDate(g.drawDate);var h=this._checkMinMax("undefined"!=typeof d?c.newDate(d,e,1):c.today(),g);g.drawDate=c.newDate(h.getFullYear(),h.getMonth()+1,"undefined"!=typeof f?f:Math.min(g.drawDate.getDate(),c.daysInMonth(h.getFullYear(),h.getMonth()+1))),this._update(b)}},changeMonth:function(b,d){var e=this._getInst(b);if(!a.isEmptyObject(e)){var f=c.add(c.newDate(e.drawDate),d,"m");this.showMonth(b,f.getFullYear(),f.getMonth()+1)}},changeDay:function(b,d){var e=this._getInst(b);if(!a.isEmptyObject(e)){var f=c.add(c.newDate(e.drawDate),d,"d");this.showMonth(b,f.getFullYear(),f.getMonth()+1,f.getDate())}},_checkMinMax:function(a,b){var d=b.get("minDate"),e=b.get("maxDate");return a=d&&a.getTime()<d.getTime()?c.newDate(d):a,a=e&&a.getTime()>e.getTime()?c.newDate(e):a},retrieveDate:function(b,c){var d=this._getInst(b);return a.isEmptyObject(d)?null:this._normaliseDate(new Date(parseInt(c.className.replace(/^.*dp(-?\d+).*$/,"$1"),10)))},selectDate:function(b,d){var e=this._getInst(b);if(!a.isEmptyObject(e)&&!this.isDisabled(b)){var f=this.retrieveDate(b,d);if(e.options.multiSelect){for(var g=!1,h=0;h<e.selectedDates.length;h++)if(f.getTime()===e.selectedDates[h].getTime()){e.selectedDates.splice(h,1),g=!0;break}!g&&e.selectedDates.length<e.options.multiSelect&&e.selectedDates.push(f)}else e.options.rangeSelect?(e.pickingRange?e.selectedDates[1]=f:e.selectedDates=[f,f],e.pickingRange=!e.pickingRange):e.selectedDates=[f];e.prevDate=e.drawDate=c.newDate(f),this._updateInput(b),e.inline||e.pickingRange||e.selectedDates.length<(e.options.multiSelect||(e.options.rangeSelect?2:1))?this._update(b):this.hide(b)}},_generateContent:function(b,d){function e(){(d.inline?a(this).closest("."+p._getMarker()):d.div).find(d.options.renderer.daySelector+" a").removeClass(d.options.renderer.highlightedClass)}var f=d.options.monthsToShow;f=a.isArray(f)?f:[1,f],d.drawDate=this._checkMinMax(d.drawDate||d.get("defaultDate")||c.today(),d);for(var g=c._applyMonthsOffset(c.newDate(d.drawDate),d),h="",i=0;i<f[0];i++){for(var j="",k=0;k<f[1];k++)j+=this._generateMonth(b,d,g.getFullYear(),g.getMonth()+1,d.options.renderer,0===i&&0===k),c.add(g,1,"m");h+=this._prepare(d.options.renderer.monthRow,d).replace(/\{months\}/,j)}var l=this._prepare(d.options.renderer.picker,d).replace(/\{months\}/,h).replace(/\{weekHeader\}/g,this._generateDayHeaders(d,d.options.renderer)),m=function(a,e,f,g,h){if(l.indexOf("{"+a+":"+g+"}")!==-1){var i=d.options.commands[g],j=d.options.commandsAsDateFormat?i.date.apply(b,[d]):null;l=l.replace(new RegExp("\\{"+a+":"+g+"\\}","g"),"<"+e+(i.status?' title="'+d.options[i.status]+'"':"")+' class="'+d.options.renderer.commandClass+" "+d.options.renderer.commandClass+"-"+g+" "+h+(i.enabled(d)?"":" "+d.options.renderer.disabledClass)+'">'+(j?c.formatDate(d.options[i.text],j,d.getConfig()):d.options[i.text])+"</"+f+">")}};for(var n in d.options.commands)d.options.commands.hasOwnProperty(n)&&(m("button",'button type="button"',"button",n,d.options.renderer.commandButtonClass),m("link",'a href="javascript:void(0)"',"a",n,d.options.renderer.commandLinkClass));if(l=a(l),f[1]>1){var o=0;a(d.options.renderer.monthSelector,l).each(function(){var b=++o%f[1];a(this).addClass(1===b?"first":0===b?"last":"")})}var p=this;l.find(d.options.renderer.daySelector+" a").hover(function(){e.apply(this),a(this).addClass(d.options.renderer.highlightedClass)},e).click(function(){p.selectDate(b,this)}).end().find("select."+this._monthYearClass+":not(."+this._anyYearClass+")").change(function(){var c=a(this).val().split("/");p.showMonth(b,parseInt(c[1],10),parseInt(c[0],10))}).end().find("select."+this._anyYearClass).click(function(){a(this).css("visibility","hidden").next("input").css({left:this.offsetLeft,top:this.offsetTop,width:this.offsetWidth,height:this.offsetHeight}).show().focus()}).end().find("input."+p._monthYearClass).change(function(){try{var c=parseInt(a(this).val(),10);c=isNaN(c)?d.drawDate.getFullYear():c,p.showMonth(b,c,d.drawDate.getMonth()+1,d.drawDate.getDate())}catch(a){window.alert(a)}}).keydown(function(b){13===b.keyCode?a(b.elem).change():27===b.keyCode&&(a(b.elem).hide().prev("select").css("visibility","visible"),d.elem.focus())});var q={elem:d.elem[0]};l.keydown(q,this._keyDown).keypress(q,this._keyPress).keyup(q,this._keyUp),l.find("."+d.options.renderer.commandClass).click(function(){if(!a(this).hasClass(d.options.renderer.disabledClass)){var e=this.className.replace(new RegExp("^.*"+d.options.renderer.commandClass+"-([^ ]+).*$"),"$1");c.performAction(b,e)}}),d.options.isRTL&&l.addClass(d.options.renderer.rtlClass),f[0]*f[1]>1&&l.addClass(d.options.renderer.multiClass),d.options.pickerClass&&l.addClass(d.options.pickerClass),a("body").append(l);var r=0;return l.find(d.options.renderer.monthSelector).each(function(){r+=a(this).outerWidth()}),l.width(r/f[0]),a.isFunction(d.options.onShow)&&d.options.onShow.apply(b,[l,d]),l},_generateMonth:function(b,d,e,f,g,h){var i=c.daysInMonth(e,f),j=d.options.monthsToShow;j=a.isArray(j)?j:[1,j];var k=d.options.fixedWeeks||j[0]*j[1]>1,l=d.options.firstDay,m=(c.newDate(e,f,1).getDay()-l+7)%7,n=k?6:Math.ceil((m+i)/7),o=d.options.selectOtherMonths&&d.options.showOtherMonths,p=d.pickingRange?d.selectedDates[0]:d.get("minDate"),q=d.get("maxDate"),r=g.week.indexOf("{weekOfYear}")>-1,s=c.today(),t=c.newDate(e,f,1);c.add(t,-m-(k&&t.getDay()===l?7:0),"d");for(var u=t.getTime(),v="",w=0;w<n;w++){for(var x=r?'<span class="dp'+u+'">'+(a.isFunction(d.options.calculateWeek)?d.options.calculateWeek(t):0)+"</span>":"",y="",z=0;z<7;z++){var A=!1;if(d.options.rangeSelect&&d.selectedDates.length>0)A=t.getTime()>=d.selectedDates[0]&&t.getTime()<=d.selectedDates[1];else for(var B=0;B<d.selectedDates.length;B++)if(d.selectedDates[B].getTime()===t.getTime()){A=!0;break}var C=a.isFunction(d.options.onDate)?d.options.onDate.apply(b,[t,t.getMonth()+1===f]):{},D=(o||t.getMonth()+1===f)&&this._isSelectable(b,t,C.selectable,p,q);y+=this._prepare(g.day,d).replace(/\{day\}/g,(D?'<a href="javascript:void(0)"':"<span")+' class="dp'+u+" "+(C.dateClass||"")+(A&&(o||t.getMonth()+1===f)?" "+g.selectedClass:"")+(D?" "+g.defaultClass:"")+((t.getDay()||7)<6?"":" "+g.weekendClass)+(t.getMonth()+1===f?"":" "+g.otherMonthClass)+(t.getTime()===s.getTime()&&t.getMonth()+1===f?" "+g.todayClass:"")+(t.getTime()===d.drawDate.getTime()&&t.getMonth()+1===f?" "+g.highlightedClass:"")+'"'+(C.title||d.options.dayStatus&&D?' title="'+(C.title||c.formatDate(d.options.dayStatus,t,d.getConfig()))+'"':"")+">"+(d.options.showOtherMonths||t.getMonth()+1===f?C.content||t.getDate():" ")+(D?"</a>":"</span>")), c.add(t,1,"d"),u=t.getTime()}v+=this._prepare(g.week,d).replace(/\{days\}/g,y).replace(/\{weekOfYear\}/g,x)}var E=this._prepare(g.month,d).match(/\{monthHeader(:[^\}]+)?\}/);E=E[0].length<=13?"MM yyyy":E[0].substring(13,E[0].length-1),E=h?this._generateMonthSelection(d,e,f,p,q,E,g):c.formatDate(E,c.newDate(e,f,1),d.getConfig());var F=this._prepare(g.weekHeader,d).replace(/\{days\}/g,this._generateDayHeaders(d,g));return this._prepare(g.month,d).replace(/\{monthHeader(:[^\}]+)?\}/g,E).replace(/\{weekHeader\}/g,F).replace(/\{weeks\}/g,v)},_generateDayHeaders:function(a,b){for(var c="",d=0;d<7;d++){var e=(d+a.options.firstDay)%7;c+=this._prepare(b.dayHeader,a).replace(/\{day\}/g,'<span class="'+this._curDoWClass+e+'" title="'+a.options.dayNames[e]+'">'+a.options.dayNamesMin[e]+"</span>")}return c},_generateMonthSelection:function(a,b,d,e,f,g){if(!a.options.changeMonth)return c.formatDate(g,c.newDate(b,d,1),a.getConfig());for(var h=a.options["monthNames"+(g.match(/mm/i)?"":"Short")],i=g.replace(/m+/i,"\\x2E").replace(/y+/i,"\\x2F"),j='<select class="'+this._monthYearClass+'" title="'+a.options.monthStatus+'">',k=1;k<=12;k++)(!e||c.newDate(b,k,c.daysInMonth(b,k)).getTime()>=e.getTime())&&(!f||c.newDate(b,k,1).getTime()<=f.getTime())&&(j+='<option value="'+k+"/"+b+'"'+(d===k?' selected="selected"':"")+">"+h[k-1]+"</option>");j+="</select>",i=i.replace(/\\x2E/,j);var l=a.options.yearRange;if("any"===l)j='<select class="'+this._monthYearClass+" "+this._anyYearClass+'" title="'+a.options.yearStatus+'"><option>'+b+'</option></select><input class="'+this._monthYearClass+" "+this._curMonthClass+d+'" value="'+b+'">';else{l=l.split(":");var m=c.today().getFullYear(),n=l[0].match("c[+-].*")?b+parseInt(l[0].substring(1),10):(l[0].match("[+-].*")?m:0)+parseInt(l[0],10),o=l[1].match("c[+-].*")?b+parseInt(l[1].substring(1),10):(l[1].match("[+-].*")?m:0)+parseInt(l[1],10);j='<select class="'+this._monthYearClass+'" title="'+a.options.yearStatus+'">',n=c.add(c.newDate(n+1,1,1),-1,"d"),o=c.newDate(o,1,1);var p=function(a,c){0!==a&&(j+='<option value="'+d+"/"+a+'"'+(b===a?' selected="selected"':"")+">"+(c||a)+"</option>")},q=null,r=null;if(n.getTime()<o.getTime()){for(n=(e&&e.getTime()>n.getTime()?e:n).getFullYear(),o=(f&&f.getTime()<o.getTime()?f:o).getFullYear(),q=Math.floor((o-n)/2),(!e||e.getFullYear()<n)&&p(n-q,a.options.earlierText),r=n;r<=o;r++)p(r);(!f||f.getFullYear()>o)&&p(o+q,a.options.laterText)}else{for(n=(f&&f.getTime()<n.getTime()?f:n).getFullYear(),o=(e&&e.getTime()>o.getTime()?e:o).getFullYear(),q=Math.floor((n-o)/2),(!f||f.getFullYear()>n)&&p(n+q,a.options.earlierText),r=n;r>=o;r--)p(r);(!e||e.getFullYear()<o)&&p(o-q,a.options.laterText)}j+="</select>"}return i=i.replace(/\\x2F/,j)},_prepare:function(a,b){var c=function(b,c){for(;;){var d=a.indexOf("{"+b+":start}");if(d===-1)return;var e=a.substring(d).indexOf("{"+b+":end}");e>-1&&(a=a.substring(0,d)+(c?a.substr(d+b.length+8,e-b.length-8):"")+a.substring(d+e+b.length+6))}};c("inline",b.inline),c("popup",!b.inline);for(var d=/\{l10n:([^\}]+)\}/,e=null;e=d.exec(a);)a=a.replace(e[0],b.options[e[1]]);return a}});var c=a.datepick;a(function(){a(document).on("mousedown."+b,c._checkExternalClick).on("resize."+b,function(){c.hide(c.curInst)})})}(jQuery);
[-] jquery.plugin.min.js
[edit]
[+]
..
[-] jquery.datepick.min.js
[edit]
[-] jquery.datepick.css
[edit]