- Added minified versions of JavaScript files including main, script, google-map, bootstrap-datepicker, and jquery.easing. - Implemented a datepicker for appointment dates and a timepicker for appointment times. - Introduced a carousel feature for image display with automatic sliding and responsive behavior. - Updated package.json to include scripts for minifying CSS and JS files, along with necessary dependencies.
1 line
26 KiB
JavaScript
1 line
26 KiB
JavaScript
((v,y)=>{var c=v(window);function w(){return new Date(Date.UTC.apply(Date,arguments))}function o(){var t=new Date;return w(t.getFullYear(),t.getMonth(),t.getDate())}function t(t){return function(){return this[t].apply(this,arguments)}}function k(t,e){this.dates=new i,this.viewDate=o(),this.focusDate=null,this._process_options(e),this.element=v(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".add-on, .input-group-addon, .btn"),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=v(C.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(t,e){return parseInt(e)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()}function r(t,e){this.element=v(t),this.inputs=v.map(e.inputs,function(t){return t.jquery?t[0]:t}),delete e.inputs,v(this.inputs).datepicker(e).bind("changeDate",v.proxy(this.dateUpdated,this)),this.pickers=v.map(this.inputs,function(t){return v(t).data("datepicker")}),this.updateDates()}e={get:function(t){return this.slice(t)[0]},contains:function(t){for(var e=t&&t.valueOf(),i=0,s=this.length;i<s;i++)if(this[i].valueOf()===e)return i;return-1},remove:function(t){this.splice(t,1)},replace:function(t){t&&(v.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.splice(0)},copy:function(){var t=new i;return t.replace(this),t}};var e,i=function(){var t=[];return t.push.apply(t,arguments),v.extend(t,e),t},s=(k.prototype={constructor:k,_process_options:function(t){this._o=v.extend({},this._o,t);var e=this.o=v.extend({},this._o),t=e.language;switch(_[t]||(t=t.split("-")[0],_[t])||(t=d.language),e.language=t,e.startView){case 2:case"decade":e.startView=2;break;case 1:case"year":e.startView=1;break;default:e.startView=0}switch(e.minViewMode){case 1:case"months":e.minViewMode=1;break;case 2:case"years":e.minViewMode=2;break;default:e.minViewMode=0}e.startView=Math.max(e.startView,e.minViewMode),!0!==e.multidate&&(e.multidate=Number(e.multidate)||!1,!1!==e.multidate?e.multidate=Math.max(0,e.multidate):e.multidate=1),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var t=C.parseFormat(e.format),i=(e.startDate!==-1/0&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=C.parseDate(e.startDate,t,e.language):e.startDate=-1/0),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=C.parseDate(e.endDate,t,e.language):e.endDate=1/0),e.daysOfWeekDisabled=e.daysOfWeekDisabled||[],v.isArray(e.daysOfWeekDisabled)||(e.daysOfWeekDisabled=e.daysOfWeekDisabled.split(/[,\s]*/)),e.daysOfWeekDisabled=v.map(e.daysOfWeekDisabled,function(t){return parseInt(t,10)}),String(e.orientation).toLowerCase().split(/\s+/g)),t=e.orientation.toLowerCase(),i=v.grep(i,function(t){return/^auto|left|right|top|bottom$/.test(t)});if(e.orientation={x:"auto",y:"auto"},t&&"auto"!==t)if(1===i.length)switch(i[0]){case"top":case"bottom":e.orientation.y=i[0];break;case"left":case"right":e.orientation.x=i[0]}else t=v.grep(i,function(t){return/^left|right$/.test(t)}),e.orientation.x=t[0]||"auto",t=v.grep(i,function(t){return/^top|bottom$/.test(t)}),e.orientation.y=t[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(t){for(var e,i,s,a=0;a<t.length;a++)e=t[a][0],2===t[a].length?(i=y,s=t[a][1]):3===t[a].length&&(i=t[a][1],s=t[a][2]),e.on(s,i)},_unapplyEvents:function(t){for(var e,i,s,a=0;a<t.length;a++)e=t[a][0],2===t[a].length?(s=y,i=t[a][1]):3===t[a].length&&(s=t[a][1],i=t[a][2]),e.off(i,s)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:v.proxy(this.show,this),keyup:v.proxy(function(t){-1===v.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:v.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:v.proxy(this.show,this),keyup:v.proxy(function(t){-1===v.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:v.proxy(this.keydown,this)}],[this.component,{click:v.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:v.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:v.proxy(function(t){this._focused_from=t.target},this)}],[this.element,{blur:v.proxy(function(t){this._focused_from=t.target},this)}]),this._secondaryEvents=[[this.picker,{click:v.proxy(this.click,this)}],[v(window),{resize:v.proxy(this.place,this)}],[v(document),{"mousedown touchstart":v.proxy(function(t){this.element.is(t.target)||this.element.find(t.target).length||this.picker.is(t.target)||this.picker.find(t.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,e){e=e||this.dates.get(-1),e=this._utc_to_local(e);this.element.trigger({type:t,date:e,dates:v.map(this.dates,this._utc_to_local),format:v.proxy(function(t,e){0===arguments.length?(t=this.dates.length-1,e=this.o.format):"string"==typeof t&&(e=t,t=this.dates.length-1),e=e||this.o.format;t=this.dates.get(t);return C.formatDate(t,e,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(t){return t&&new Date(t.getTime()+6e4*t.getTimezoneOffset())},_local_to_utc:function(t){return t&&new Date(t.getTime()-6e4*t.getTimezoneOffset())},_zero_time:function(t){return t&&new Date(t.getFullYear(),t.getMonth(),t.getDate())},_zero_utc_time:function(t){return t&&new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},getDates:function(){return v.map(this.dates,this._utc_to_local)},getUTCDates:function(){return v.map(this.dates,function(t){return new Date(t)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var t=v.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){var t=v.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,v.map(t,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:t("setDates"),setUTCDate:t("setUTCDates"),setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t).change():this.component&&this.element.find("input").val(t).change()},getFormattedDate:function(e){e===y&&(e=this.o.format);var i=this.o.language;return v.map(this.dates,function(t){return C.formatDate(t,e,i)}).join(this.o.multidateSeparator)},setStartDate:function(t){this._process_options({startDate:t}),this.update(),this.updateNavArrows()},setEndDate:function(t){this._process_options({endDate:t}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this._process_options({daysOfWeekDisabled:t}),this.update(),this.updateNavArrows()},place:function(){var t,e,i,s,a,n,h,o,r,d,l;this.isInline||(l=this.picker.outerWidth(),t=this.picker.outerHeight(),d=c.width(),e=c.height(),i=c.scrollTop(),s=parseInt(this.element.parents().filter(function(){return"auto"!==v(this).css("z-index")}).first().css("z-index"))+10,a=(this.component?this.component.parent():this.element).offset(),n=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),r=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=a.left,o=a.top,this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(h-=l-r)):(this.picker.addClass("datepicker-orient-left"),a.left<0?h-=a.left-10:a.left+l>d&&(h=d-l-10)),"auto"===(r=this.o.orientation.y)&&(d=-i+a.top-t,l=i+e-(a.top+n+t),r=Math.max(d,l)===l?"top":"bottom"),this.picker.addClass("datepicker-orient-"+r),"top"===r?o+=n:o-=t+parseInt(this.picker.css("padding-top")),this.picker.css({top:o,left:h,zIndex:s}))},_allow_update:!0,update:function(){var t,i,e;this._allow_update&&(t=this.dates.copy(),e=!(i=[]),arguments.length?(v.each(arguments,v.proxy(function(t,e){e instanceof Date&&(e=this._local_to_utc(e)),i.push(e)},this)),e=!0):(i=(i=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val())&&this.o.multidate?i.split(this.o.multidateSeparator):[i],delete this.element.data().date),i=v.map(i,v.proxy(function(t){return C.parseDate(t,this.o.format,this.o.language)},this)),i=v.grep(i,v.proxy(function(t){return t<this.o.startDate||t>this.o.endDate||!t},this),!0),this.dates.replace(i),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),e?this.setValue():i.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill())},fillDow:function(){var t,e=this.o.weekStart,i="<tr>";for(this.o.calendarWeeks&&(i+=t='<th class="cw"> </th>',this.picker.find(".datepicker-days thead tr:first-child").prepend(t));e<this.o.weekStart+7;)i+='<th class="dow">'+_[this.o.language].daysMin[e++%7]+"</th>";i+="</tr>",this.picker.find(".datepicker-days thead").append(i)},fillMonths:function(){for(var t="",e=0;e<12;)t+='<span class="month">'+_[this.o.language].monthsShort[e++]+"</span>";this.picker.find(".datepicker-months td").html(t)},setRange:function(t){t&&t.length?this.range=v.map(t,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(t){var e=[],i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),a=new Date;return t.getUTCFullYear()<i||t.getUTCFullYear()===i&&t.getUTCMonth()<s?e.push("old"):(t.getUTCFullYear()>i||t.getUTCFullYear()===i&&t.getUTCMonth()>s)&&e.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&e.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===a.getFullYear()&&t.getUTCMonth()===a.getMonth()&&t.getUTCDate()===a.getDate()&&e.push("today"),-1!==this.dates.contains(t)&&e.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||-1!==v.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled))&&e.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&e.push("range"),-1!==v.inArray(t.valueOf(),this.range))&&e.push("selected"),e},fill:function(){for(var t,e,i,s=new Date(this.viewDate),a=s.getUTCFullYear(),s=s.getUTCMonth(),n=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,h=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,o=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,r=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,d=_[this.o.language].today||_.en.today||"",l=_[this.o.language].clear||_.en.clear||"",c=(this.picker.find(".datepicker-days thead th.datepicker-switch").text(_[this.o.language].months[s]+" "+a),this.picker.find("tfoot th.today").text(d).toggle(!1!==this.o.todayBtn),this.picker.find("tfoot th.clear").text(l).toggle(!1!==this.o.clearBtn),this.updateNavArrows(),this.fillMonths(),w(a,s-1,28)),d=C.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth()),u=(c.setUTCDate(d),c.setUTCDate(d-(c.getUTCDay()-this.o.weekStart+7)%7),new Date(c)),p=(u.setUTCDate(u.getUTCDate()+42),u=u.valueOf(),[]);c.valueOf()<u;)c.getUTCDay()===this.o.weekStart&&(p.push("<tr>"),this.o.calendarWeeks)&&(e=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),e=new Date(Number(e)+(11-e.getUTCDay())%7*864e5),i=new Date(Number(i=w(e.getUTCFullYear(),0,1))+(11-i.getUTCDay())%7*864e5),p.push('<td class="cw">'+((e-i)/864e5/7+1)+"</td>")),(e=this.getClassNames(c)).push("day"),this.o.beforeShowDay!==v.noop&&((i=this.o.beforeShowDay(this._utc_to_local(c)))===y?i={}:"boolean"==typeof i?i={enabled:i}:"string"==typeof i&&(i={classes:i}),!1===i.enabled&&e.push("disabled"),i.classes&&(e=e.concat(i.classes.split(/\s+/))),i.tooltip)&&(t=i.tooltip),e=v.unique(e),p.push('<td class="'+e.join(" ")+'"'+(t?' title="'+t+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()===this.o.weekEnd&&p.push("</tr>"),c.setUTCDate(c.getUTCDate()+1);this.picker.find(".datepicker-days tbody").empty().append(p.join(""));for(var f,g=this.picker.find(".datepicker-months").find("th:eq(1)").text(a).end().find("span").removeClass("active"),l=(v.each(this.dates,function(t,e){e.getUTCFullYear()===a&&g.eq(e.getUTCMonth()).addClass("active")}),(a<n||o<a)&&g.addClass("disabled"),a===n&&g.slice(0,h).addClass("disabled"),a===o&&g.slice(r+1).addClass("disabled"),p="",a=10*parseInt(a/10,10),this.picker.find(".datepicker-years").find("th:eq(1)").text(a+"-"+(a+9)).end().find("td")),D=(--a,v.map(this.dates,function(t){return t.getUTCFullYear()})),m=-1;m<11;m++)f=["year"],-1===m?f.push("old"):10===m&&f.push("new"),-1!==v.inArray(a,D)&&f.push("active"),(a<n||o<a)&&f.push("disabled"),p+='<span class="'+f.join(" ")+'">'+a+"</span>",a+=1;l.html(p)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&e>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&e>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(t){t.preventDefault();var e,i,s,a,n=v(t.target).closest("span, td, th");if(1===n.length)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var h=C.modes[this.viewMode].navStep*("prev"===n[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,h),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,h),1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var o=w((o=new Date).getFullYear(),o.getMonth(),o.getDate(),0,0,0),r=(this.showMode(-2),"linked"===this.o.todayBtn?null:"view");this._setDate(o,r);break;case"clear":this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a&&a.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".disabled")||(this.viewDate.setUTCDate(1),n.is(".month")?(s=1,i=n.parent().find("span").index(n),e=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(i),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(w(e,i,s))):(s=1,i=0,e=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(e),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(w(e,i,s))),this.showMode(-1),this.fill());break;case"td":n.is(".day")&&!n.is(".disabled")&&(s=parseInt(n.text(),10)||1,e=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),n.is(".old")?0===i?(i=11,--e):--i:n.is(".new")&&(11===i?(i=0,e+=1):i+=1),this._setDate(w(e,i,s)))}this.picker.is(":visible")&&this._focused_from&&v(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t?-1!==e?this.dates.remove(e):this.dates.push(t):this.dates.clear(),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){var i;e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),e&&"view"!==e||(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),this._trigger("changeDate"),this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.change(),!this.o.autoclose||e&&"date"!==e||this.hide()},moveMonth:function(t,e){if(!t)return y;if(!e)return t;var i,s,a=new Date(t.valueOf()),n=a.getUTCDate(),h=a.getUTCMonth(),o=Math.abs(e);if(e=0<e?1:-1,1===o)s=-1===e?function(){return a.getUTCMonth()===h}:function(){return a.getUTCMonth()!==i},i=h+e,a.setUTCMonth(i),(i<0||11<i)&&(i=(i+12)%12);else{for(var r=0;r<o;r++)a=this.moveMonth(a,e);i=a.getUTCMonth(),a.setUTCDate(n),s=function(){return i!==a.getUTCMonth()}}for(;s();)a.setUTCDate(--n),a.setUTCMonth(i);return a},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))27===t.keyCode&&this.show();else{var e,i,s,a,n=!1,h=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault();break;case 37:case 39:this.o.keyboardNavigation&&(e=37===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||o(),e),s=this.moveYear(h,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||o(),e),s=this.moveMonth(h,e),this._trigger("changeMonth",this.viewDate)):((i=new Date(this.dates.get(-1)||o())).setUTCDate(i.getUTCDate()+e),(s=new Date(h)).setUTCDate(h.getUTCDate()+e)),this.dateWithinRange(i))&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),t.preventDefault());break;case 38:case 40:this.o.keyboardNavigation&&(e=38===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||o(),e),s=this.moveYear(h,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||o(),e),s=this.moveMonth(h,e),this._trigger("changeMonth",this.viewDate)):((i=new Date(this.dates.get(-1)||o())).setUTCDate(i.getUTCDate()+7*e),(s=new Date(h)).setUTCDate(h.getUTCDate()+7*e)),this.dateWithinRange(i))&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),t.preventDefault());break;case 32:break;case 13:h=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(h),n=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),this.o.autoclose)&&this.hide();break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}n&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a)&&a.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+C.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}},r.prototype={updateDates:function(){this.dates=v.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var i=v.map(this.dates,function(t){return t.valueOf()});v.each(this.pickers,function(t,e){e.setRange(i)})},dateUpdated:function(t){if(!this.updating){this.updating=!0;var i=v(t.target).data("datepicker").getUTCDate(),e=v.inArray(t.target,this.inputs),s=this.inputs.length;if(-1!==e){if(v.each(this.pickers,function(t,e){e.getUTCDate()||e.setUTCDate(i)}),i<this.dates[e])for(;0<=e&&i<this.dates[e];)this.pickers[e--].setUTCDate(i);else if(i>this.dates[e])for(;e<s&&i>this.dates[e];)this.pickers[e++].setUTCDate(i);this.updateDates(),delete this.updating}}},remove:function(){v.map(this.pickers,function(t){t.remove()}),delete this.element.data().datepicker}},v.fn.datepicker),d=(v.fn.datepicker=function(n){var h,o=Array.apply(null,arguments);return o.shift(),this.each(function(){var t,e,i=v(this),s=i.data("datepicker"),a="object"==typeof n&&n;if(s||(e=((t,e)=>{var i,s=v(t).data(),a={},n=new RegExp("^"+e.toLowerCase()+"([A-Z])");function h(t,e){return e.toLowerCase()}for(i in e=new RegExp("^"+e.toLowerCase()),s)e.test(i)&&(a[i.replace(n,h)]=s[i]);return a})(this,"date"),t=(t=>{var i,s={};if(_[t]||(t=t.split("-")[0],_[t]))return i=_[t],v.each(l,function(t,e){e in i&&(s[e]=i[e])}),s})(v.extend({},d,e,a).language),t=v.extend({},d,t,e,a),i.is(".input-daterange")||t.inputs?(e={inputs:t.inputs||i.find("input").toArray()},i.data("datepicker",s=new r(this,v.extend(t,e)))):i.data("datepicker",s=new k(this,t))),"string"==typeof n&&"function"==typeof s[n]&&(h=s[n].apply(s,o))!==y)return!1}),h!==y?h:this},v.fn.datepicker.defaults={autoclose:!1,beforeShowDay:v.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0}),l=v.fn.datepicker.locale_opts=["format","rtl","weekStart"],_=(v.fn.datepicker.Constructor=k,v.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["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"],today:"Today",clear:"Clear"}}),C={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},getDaysInMonth:function(t,e){return[31,C.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\0").split("\0"),t=t.match(this.validParts);if(e&&e.length&&t&&0!==t.length)return{separators:e,parts:t};throw new Error("Invalid date format.")},parseDate:function(t,e,i){if(!t)return y;if(!(t instanceof Date)){"string"==typeof e&&(e=C.parseFormat(e));var s,a,n=/([\-+]\d+)([dmwy])/,h=t.match(/([\-+]\d+)([dmwy])/g);if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){for(t=new Date,g=0;g<h.length;g++)switch(s=n.exec(h[g]),a=parseInt(s[1]),s[2]){case"d":t.setUTCDate(t.getUTCDate()+a);break;case"m":t=k.prototype.moveMonth.call(k.prototype,t,a);break;case"w":t.setUTCDate(t.getUTCDate()+7*a);break;case"y":t=k.prototype.moveYear.call(k.prototype,t,a)}return w(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}h=t&&t.match(this.nonpunctuation)||[],t=new Date;var o,r,d={},l=["yyyy","yy","M","MM","m","mm","d","dd"],c={yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){if(!isNaN(t)){for(--e;e<0;)e+=12;for(t.setUTCMonth(e%=12);t.getUTCMonth()!==e;)t.setUTCDate(t.getUTCDate()-1)}return t},d:function(t,e){return t.setUTCDate(e)}},u=(c.M=c.MM=c.mm=c.m,c.dd=c.d,t=w(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e.parts.slice());if(h.length!==u.length&&(u=v(u).filter(function(t,e){return-1!==v.inArray(e,l)}).toArray()),h.length===u.length){for(var p,f,g=0,D=u.length;g<D;g++){if(o=parseInt(h[g],10),s=u[g],isNaN(o))switch(s){case"MM":r=v(_[i].months).filter(m),o=v.inArray(r[0],_[i].months)+1;break;case"M":r=v(_[i].monthsShort).filter(m),o=v.inArray(r[0],_[i].monthsShort)+1}d[s]=o}for(g=0;g<l.length;g++)(f=l[g])in d&&!isNaN(d[f])&&(p=new Date(t),c[f](p,d[f]),isNaN(p)||(t=p))}}return t;function m(){var t=this.slice(0,h[g].length);return t===h[g].slice(0,t.length)}},formatDate:function(t,e,i){if(!t)return"";"string"==typeof e&&(e=C.parseFormat(e));for(var s={d:t.getUTCDate(),D:_[i].daysShort[t.getUTCDay()],DD:_[i].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:_[i].monthsShort[t.getUTCMonth()],MM:_[i].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()},a=(s.dd=(s.d<10?"0":"")+s.d,s.mm=(s.m<10?"0":"")+s.m,t=[],v.extend([],e.separators)),n=0,h=e.parts.length;n<=h;n++)a.length&&t.push(a.shift()),t.push(s[e.parts[n]]);return t.join("")},headTemplate:'<thead><tr><th class="prev">«</th><th colspan="5" class="datepicker-switch"></th><th class="next">»</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};C.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+C.headTemplate+"<tbody></tbody>"+C.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+C.headTemplate+C.contTemplate+C.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+C.headTemplate+C.contTemplate+C.footTemplate+"</table></div></div>",v.fn.datepicker.DPGlobal=C,v.fn.datepicker.noConflict=function(){return v.fn.datepicker=s,this},v(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var e=v(this);e.data("datepicker")||(t.preventDefault(),e.datepicker("show"))}),v(function(){v('[data-provide="datepicker-inline"]').datepicker()})})(window.jQuery); |