kollapsminoriteten/wp-content/plugins/the-events-calendar/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js

5 lines
33 KiB
JavaScript
Raw Normal View History

2023-09-26 10:09:00 +02:00
/*!
* Datepicker for Bootstrap v1.7.0 (https://github.com/uxsolutions/bootstrap-datepicker)
*
* Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function($,h){function i(){return new Date(Date.UTC.apply(Date,arguments))}function j(){var a=new Date;return i(a.getFullYear(),a.getMonth(),a.getDate())}function k(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function b(a,b){return function(){return b!==h&&$.fn.bootstrapDatepicker.deprecated(b),this[a].apply(this,arguments)}}var e,l=(e={get:function(a){return this.slice(a)[0]},contains:function(b){for(var c=b&&b.valueOf(),a=0,d=this.length;a<d;a++)if(0<=this[a].valueOf()-c&&this[a].valueOf()-c<864e5)return a;return -1},remove:function(a){this.splice(a,1)},replace:function(a){a&&(Array.isArray(a)||(a=[a]),this.clear(),this.push.apply(this,a))},clear:function(){this.length=0},copy:function(){var a=new l;return a.replace(this),a}},function(){var a=[];return a.push.apply(a,arguments),$.extend(a,e),a}),c=function(b,c){$.data(b,"datepicker",this),this._process_options(c),this.dates=new l,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=$(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=$(a.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),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.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(b,a){return Number(a)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};c.prototype={constructor:c,_resolveViewName:function(b){return $.each(a.viewModes,function(a,c){if(b===a|| -1!==$.inArray(b,c.names))return b=a,!1}),b},_resolveDaysOfWeek:function(a){return Array.isArray(a)||(a=a.split(/[,\s]*/)),$.map(a,Number)},_check_template:function(a){try{if(a===h||""===a)return!1;if((a.match(/[<>]/g)||[]).length<=0)return!0;return $(a).length>0}catch(b){return!1}},_process_options:function(h){this._o=$.extend({},this._o,h);var b=this.o=$.extend({},this._o),f=b.language;o[f]||o[f=f.split("-")[0]]||(f=d.language),b.language=f,b.startView=this._resolveViewName(b.startView),b.minViewMode=this._resolveViewName(b.minViewMode),b.maxViewMode=this._resolveViewName(b.maxViewMode),b.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,b.startView)),!0!==b.multidate&&(b.multidate=Number(b.multidate)||!1,!1!==b.multidate&&(b.multidate=Math.max(0,b.multidate))),b.multidateSeparator=String(b.multidateSeparator),b.weekStart%=7,b.weekEnd=(b.weekStart+6)%7;var g=a.parseFormat(b.format);b.startDate!== -1/0&&(b.startDate?b.startDate instanceof Date?b.startDate=this._local_to_utc(this._zero_time(b.startDate)):b.startDate=a.parseDate(b.startDate,g,b.language,b.assumeNearbyYear):b.startDate=-1/0),b.endDate!==1/0&&(b.endDate?b.endDate instanceof Date?b.endDate=this._local_to_utc(this._zero_time(b.endDate)):b.endDate=a.parseDate(b.endDate,g,b.language,b.assumeNearbyYear):b.endDate=1/0),b.daysOfWeekDisabled=this._resolveDaysOfWeek(b.daysOfWeekDisabled||[]),b.daysOfWeekHighlighted=this._resolveDaysOfWeek(b.daysOfWeekHighlighted||[]),b.dat