UNPKG

@syncfusion/ej2-calendars

Version:

A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.

10 lines 386 kB
/*! * filename: ej2-calendars.min.js * version : 29.1.35 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionLists")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPopups","SyncfusionInputs","SyncfusionButtons","SyncfusionLists"],t):"object"==typeof exports?exports.SyncfusionCalendars=t(require("SyncfusionBase"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionLists")):e.SyncfusionCalendars=t(e.SyncfusionBase,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionButtons,e.SyncfusionLists)}(self,((e,t,i,s,a)=>(()=>{"use strict";var n={766:t=>{t.exports=e},741:e=>{e.exports=s},323:e=>{e.exports=i},90:e=>{e.exports=a},197:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,l),i.exports}l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{l.r(o),l.d(o,{Calendar:()=>T,CalendarBase:()=>I,DatePicker:()=>Q,DateRangePicker:()=>_e,DateTimePicker:()=>At,Islamic:()=>L,MaskedDateTime:()=>Bt,Presets:()=>Ke,TimeMaskPlaceholder:()=>dt,TimePicker:()=>pt,TimePickerBase:()=>t});var e,t,i=l(766),s=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}),a=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},n="e-other-month",r="e-other-year",h="e-calendar",u="e-device",d="e-rtl",p="e-year",c="e-month",m="e-decade",f="e-icons",v="e-disabled",g="e-overlay",y="e-week-number",b="e-selected",D="e-focused-date",E="e-focused-cell",C="e-month-hide",k="e-today",M="e-day",w="e-cell",V="e-zoomin",N="e-calendar-day-header-lg",O=864e5,I=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.effect="",s.isPopupClicked=!1,s.isDateSelected=!0,s.isTodayClicked=!1,s.preventChange=!1,s.previousDates=!1,s}return s(t,e),t.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)==+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new i.Internationalization(this.locale),((0,i.isNullOrUndefined)(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(h),this.enableRtl&&this.element.classList.add(d),i.Browser.isDevice&&this.element.classList.add(u),(0,i.attributes)(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(h),this.enableRtl&&this.calendarElement.classList.add(d),i.Browser.isDevice&&this.calendarElement.classList.add(u),(0,i.attributes)(this.calendarElement,{"data-role":"calendar"})),!(0,i.isNullOrUndefined)((0,i.closest)(this.element,"fieldset"))&&(0,i.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){(0,i.isNullOrUndefined)(e)&&this.setProperties({min:new Date(1900,0,1)},!0),(0,i.isNullOrUndefined)(t)&&this.setProperties({max:new Date(2099,11,31)},!0)},t.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},t.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!(0,i.isNullOrUndefined)(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},t.prototype.setOverlayIndex=function(e,t,s,a){if(a&&!(0,i.isNullOrUndefined)(t)&&!(0,i.isNullOrUndefined)(s)&&!(0,i.isNullOrUndefined)(e)){var n=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},t.prototype.minMaxUpdate=function(e){+this.min<=+this.max?(0,i.removeClass)([this.element],g):(this.setProperties({min:this.min},!0),(0,i.addClass)([this.element],g)),this.min=(0,i.isNullOrUndefined)(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=(0,i.isNullOrUndefined)(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.createHeader=function(){var e={tabindex:"0"};this.headerElement=this.createElement("div",{className:"e-header"});var t=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),(0,i.rippleEffect)(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),(0,i.attributes)(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),(0,i.attributes)(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),(0,i.rippleEffect)(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&((0,i.attributes)(this.previousIcon,{tabIndex:"-1"}),(0,i.attributes)(this.nextIcon,{tabIndex:"-1"})),(0,i.attributes)(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),(0,i.attributes)(this.nextIcon,e),this.headerTitleElement=this.createElement("div",{className:M+" e-title"}),(0,i.attributes)(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),(0,i.attributes)(this.headerTitleElement,e),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+f})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next "+f})),t.appendChild(this.previousIcon),t.appendChild(this.nextIcon),this.headerElement.appendChild(t),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},t.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{class:"e-calendar-content-table",tabIndex:"0",role:"grid","aria-activedescendant":"","aria-labelledby":this.element.id}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter(),"daterangepicker"!==this.getModuleName()&&(i.EventHandler.add(this.table,"focus",this.addContentFocus,this),i.EventHandler.add(this.table,"blur",this.removeContentFocus,this))},t.prototype.addContentFocus=function(e){var t=this.tableBodyElement.querySelector("tr td.e-focused-date"),s=this.tableBodyElement.querySelector("tr td.e-selected");(0,i.isNullOrUndefined)(s)?(0,i.isNullOrUndefined)(t)||t.classList.add(E):s.classList.add(E)},t.prototype.removeContentFocus=function(e){var t=(0,i.isNullOrUndefined)(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),s=(0,i.isNullOrUndefined)(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");(0,i.isNullOrUndefined)(s)?(0,i.isNullOrUndefined)(t)||t.classList.remove(E):s.classList.remove(E)},t.prototype.getCultureValues=function(){var e,t=[],s=(0,i.isNullOrUndefined)(this.dayHeaderFormat)?null:"days.stand-alone."+this.dayHeaderFormat.toLowerCase();if(e="en"!==this.locale&&"en-US"!==this.locale||(0,i.isNullOrUndefined)(s)?this.getCultureObjects(i.cldrData,""+this.locale):(0,i.getValue)(s,(0,i.getDefaultDateObject)()),!(0,i.isNullOrUndefined)(e))for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];t.push((0,i.getValue)(r,e))}return t},t.prototype.toCapitalize=function(e){return!(0,i.isNullOrUndefined)(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?(0,i.isNullOrUndefined)(this.element.querySelectorAll(".e-content .e-week-header")[0])||(0,i.detach)(this.element.querySelectorAll(".e-content .e-week-header")[0]):(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||(0,i.detach)(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number" aria-hidden="true"></th>',"calendar"===this.getModuleName()?(0,i.addClass)([this.element],""+y):(0,i.addClass)([this.calendarElement],""+y));var t=this.getCultureValues().length>0&&this.getCultureValues()?this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek):null;if(!(0,i.isNullOrUndefined)(t))for(var s=0;s<=6;s++)e+='<th class="">'+this.toCapitalize(t[s])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?(0,i.isNullOrUndefined)(this.element.querySelectorAll(".e-content tbody")[0])||(0,i.detach)(this.element.querySelectorAll(".e-content tbody")[0]):(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content tbody")[0])||(0,i.detach)(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},t.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today")),this.todayElement.setAttribute("tabindex","0")},t.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),t=new Date(+this.max);this.globalize=new i.Internationalization(this.locale),this.l10=new i.L10n(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),(0,i.rippleEffect)(this.todayElement),this.updateFooter(),(0,i.addClass)([this.todayElement],["e-btn",k,"e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(t.setHours(0,0,0,0))&&!this.todayDisabled||(0,i.addClass)([this.todayElement],v),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(v)||i.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,s,a){i.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new i.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new i.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,s,a){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=(0,i.extend)(this.defaultKeyConfigs,s),this.serverModuleName=a},t.prototype.todayButtonClick=function(e,t,i){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),i):this.navigateTo("Month",new Date(this.checkValue(t)),i))},t.prototype.resetCalendar=function(){this.calendarElement&&(0,i.detach)(this.calendarElement),this.tableBodyElement&&(0,i.detach)(this.tableBodyElement),this.table&&(0,i.detach)(this.table),this.tableHeadElement&&(0,i.detach)(this.tableHeadElement),this.nextIcon&&(0,i.detach)(this.nextIcon),this.previousIcon&&(0,i.detach)(this.previousIcon),this.footer&&(0,i.detach)(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},t.prototype.keyActionHandle=function(e,t,s){if(null!==this.calendarElement||"escape"!==e.action){var a,n=this.tableBodyElement.querySelector("tr td.e-focused-date");a=s?(0,i.isNullOrUndefined)(n)||+t!==parseInt(n.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):n:this.tableBodyElement.querySelector("tr td.e-selected");var r=this.getViewNumber(this.currentView()),l=this.getViewNumber(this.depth),o=r===l&&this.getViewNumber(this.start)>=l;switch(this.effect="",e.action){case"moveLeft":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(this.keyboardNavigate(-1,r,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(this.keyboardNavigate(1,r,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(0===r?this.keyboardNavigate(-7,r,e,this.max,this.min):this.keyboardNavigate(-4,r,e,this.max,this.min),e.preventDefault());break;case"moveDown":"daterangepicker"===this.getModuleName()||(0,i.isNullOrUndefined)(e.target)||(0===r?this.keyboardNavigate(7,r,e,this.max,this.min):this.keyboardNavigate(4,r,e,this.max,this.min),e.preventDefault());break;case"select":if(e.target===this.headerTitleElement)this.navigateTitle(e);else if(e.target!==this.previousIcon||e.target.className.includes(v))if(e.target!==this.nextIcon||e.target.className.includes(v))if(e.target!==this.todayElement||e.target.className.includes(v)){var h=(0,i.isNullOrUndefined)(n)?a:n;if(!(0,i.isNullOrUndefined)(h)&&!h.classList.contains(v))if(o){var u=new Date(parseInt(""+h.id,0));this.selectDate(e,u,h),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement.focus():this.element.focus())}else e.target.className.includes(v)||this.contentClick(null,--r,h,t)}else this.todayButtonClick(e,t),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement.focus():this.element.focus());else this.navigateNext(e);else this.navigatePrevious(e);break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":((0,i.isNullOrUndefined)(n)||o)&&((0,i.isNullOrUndefined)(a)||o)||this.contentClick(null,--r,n||a,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),(0,i.detach)(this.tableBodyElement),0===r?this.renderMonths(e):1===r?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,r),(0,i.detach)(this.tableBodyElement),0===r?this.renderMonths(e):1===r?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault();break;case"tab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.todayElement||(e.preventDefault(),this.isAngular?this.inputElement.focus():this.element.focus(),this.hide());break;case"shiftTab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement||(e.preventDefault(),this.isAngular?this.inputElement.focus():this.element.focus(),this.hide());break;case"escape":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement&&e.target!==this.previousIcon&&e.target!==this.nextIcon&&e.target!==this.todayElement||this.hide()}}},t.prototype.keyboardNavigate=function(e,t,s,a,n){var r=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?((0,i.detach)(this.tableBodyElement),this.renderDecades(s)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?((0,i.detach)(this.tableBodyElement),this.renderYears(s)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,s,a,n),this.isMinMaxRange(this.currentDate)?((0,i.detach)(this.tableBodyElement),this.renderMonths(s)):this.currentDate=r}},t.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},t.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),i=new Date(new Date(+this.min).setHours(0,0,0,0)),s=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+i&&+t!=+s||(+e<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},t.prototype.renderMonths=function(e,t,s){var a,n=this.weekNumber?8:7;a="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,s,e):(0,i.isNullOrUndefined)(this.islamicModule)?null:this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(a,n,c,e,t):(0,i.isNullOrUndefined)(this.islamicModule)||this.islamicModule.islamicRenderTemplate(a,n,c,e,t)},t.prototype.renderDays=function(e,t,s,a,r,l){var o,h=[],u=r?new Date(+e):this.getDate(new Date,this.timezone),d=new Date(this.checkValue(e)),p=d.getMonth();this.titleUpdate(e,"days");var c=d;for(d=new Date(c.getFullYear(),c.getMonth(),0,c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds());d.getDay()!==this.firstDayOfWeek;)this.setStartDate(d,-864e5);for(var m=0;m<42;++m){var f=this.createElement("td",{className:w}),D=this.createElement("span");if(m%7==0&&this.weekNumber){var E="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,C=new Date(d.getFullYear(),d.getMonth(),d.getDate()+E);D.textContent=""+this.getWeek(C),f.appendChild(D),(0,i.addClass)([f],""+y),h.push(f)}o=new Date(+d),d=this.minMaxDate(d);var M={type:"dateTime",skeleton:"full"},V=this.globalize.parseDate(this.globalize.formatDate(d,M),M),N=this.dayCell(d),O=this.globalize.formatDate(d,{type:"date",skeleton:"full"}),I=this.createElement("span");I.textContent=this.globalize.formatDate(d,{format:"d",type:"date",skeleton:"yMd"});var T=this.min>d||this.max<d;T?((0,i.addClass)([N],v),(0,i.addClass)([N],g)):I.setAttribute("title",""+O),p!==d.getMonth()&&((0,i.addClass)([N],n),I.setAttribute("aria-disabled","true")),0!==d.getDay()&&6!==d.getDay()||(0,i.addClass)([N],"e-weekend"),N.appendChild(I),this.renderDayCellArgs={date:d,isDisabled:!1,element:N,isOutOfRange:T};var x=this.renderDayCellArgs;if(this.renderDayCellEvent(x),x.isDisabled){var S=new Date(this.checkValue(t)),P=new Date(this.checkValue(x.date));if(s){if(!(0,i.isNullOrUndefined)(a)&&a.length>0)for(var A=0;A<a.length;A++){+new Date(this.globalize.formatDate(x.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(a[A],{type:"date",skeleton:"yMd"}))&&(a.splice(A,1),A=-1)}}else S&&+S==+P&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!N.classList.contains(b)&&((0,i.addClass)([N],v),(0,i.addClass)([N],g),I.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var U=N.classList.contains(n),H=N.classList.contains(v);H||i.EventHandler.add(N,"click",this.clickHandler,this);var W=void 0;if((0,i.isNullOrUndefined)(l)||"click"!==l.type||(W=l.currentTarget),!s||(0,i.isNullOrUndefined)(a)||H)!H&&this.getDateVal(d,t)&&(0,i.addClass)([N],b);else{for(var F=0;F<a.length;F++){var L={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(d,L)===this.globalize.formatDate(a[F],L)&&this.getDateVal(d,a[F])||this.getDateVal(d,t))&&(0,i.addClass)([N],b),!(0,i.isNullOrUndefined)(W)&&W.innerText===N.innerText&&this.previousDates&&N.classList.contains(b)&&W.classList.contains(b)){(0,i.removeClass)([N],b),this.previousDates=!1;for(var B=this.copyValues(a),j=0;j<B.length;j++){var Y={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(V,Y)===this.globalize.formatDate(B[j],Y)){A=B.indexOf(B[j]);B.splice(A,1),a.splice(A,1)}}this.setProperties({values:B},!0)}else this.updateFocus(U,H,d,N,e)}a.length<=0&&this.updateFocus(U,H,d,N,e)}this.updateFocus(U,H,d,N,e),(0,i.isNullOrUndefined)(V)||V.getFullYear()!==u.getFullYear()||V.getMonth()!==u.getMonth()||V.getDate()!==u.getDate()||(0,i.addClass)([N],k),h.push(this.renderDayCellArgs.element),d=new Date(+o),this.addDay(d,1,null,this.max,this.min)}return h},t.prototype.updateFocus=function(e,t,s,a,n){n.getDate()!==s.getDate()||e||t?(n>=this.max&&parseInt(a.id,0)===+this.max&&!e&&!t&&(0,i.addClass)([a],D),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!t&&(0,i.addClass)([a],D)):(0,i.addClass)([a],D)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var s=[],a=(0,i.isNullOrUndefined)(t),n=new Date(this.checkValue(this.currentDate)),r=n.getMonth(),l=n.getFullYear(),o=n,h=o.getFullYear(),u=new Date(this.checkValue(this.min)).getFullYear(),d=new Date(this.checkValue(this.min)).getMonth(),c=new Date(this.checkValue(this.max)).getFullYear(),m=new Date(this.checkValue(this.max)).getMonth();o.setMonth(0),this.titleUpdate(this.currentDate,"months"),o.setDate(1);for(var f=0;f<12;++f){var g=this.dayCell(o),y=this.createElement("span"),E=t&&t.getMonth()===o.getMonth(),C=t&&t.getFullYear()===l&&E,k=this.globalize.formatDate(o,{type:"date",format:"MMM y"});y.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<u||f<d&&h===u)||this.max&&(h>c||f>m&&h>=c)?(0,i.addClass)([g],v):!a&&C?(0,i.addClass)([g],b):o.getMonth()===r&&this.currentDate.getMonth()===r&&(0,i.addClass)([g],D),o.setDate(1),o.setMonth(o.getMonth()+1),g.classList.contains(v)||(i.EventHandler.add(g,"click",this.clickHandler,this),y.setAttribute("title",""+k)),g.appendChild(y),s.push(g)}this.renderTemplate(s,4,p,e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var s=[],a=new Date(this.checkValue(this.currentDate));a.setMonth(0),a.setDate(1);var n=a.getFullYear(),l=new Date(a.setFullYear(n-n%10)),o=new Date(a.setFullYear(n-n%10+9)),h=l.getFullYear(),u=o.getFullYear(),d=this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"y"}),p=this.globalize.formatDate(o,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=d+" - "+p;for(var c=new Date(n-n%10-1,0,1).getFullYear(),m=0;m<12;++m){var f=c+m;a.setFullYear(f);var g=this.dayCell(a),y=this.createElement("span");y.textContent=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),f<h||f>u?((0,i.addClass)([g],r),y.setAttribute("aria-disabled","true"),(0,i.isNullOrUndefined)(t)||a.getFullYear()!==t.getFullYear()||(0,i.addClass)([g],b),(f<new Date(this.checkValue(this.min)).getFullYear()||f>new Date(this.checkValue(this.max)).getFullYear())&&(0,i.addClass)([g],v)):f<new Date(this.checkValue(this.min)).getFullYear()||f>new Date(this.checkValue(this.max)).getFullYear()?(0,i.addClass)([g],v):(0,i.isNullOrUndefined)(t)||a.getFullYear()!==t.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||g.classList.contains(v)||(0,i.addClass)([g],D):(0,i.addClass)([g],b),g.classList.contains(v)||(i.EventHandler.add(g,"click",this.clickHandler,this),y.setAttribute("title",""+y.textContent)),g.appendChild(y),s.push(g)}this.renderTemplate(s,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t,s={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},a=this.globalize.parseDate(this.globalize.formatDate(e,s),s);(0,i.isNullOrUndefined)(a)||(t=a.valueOf());var n={className:w,attrs:{id:""+(0,i.getUniqueID)(""+t),"aria-selected":"false"}};return this.createElement("td",n)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+n+"):not(."+y+")"):this.tableBodyElement.querySelectorAll("td:not(."+r);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(v)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.lastDay=function(e,t){var i=new Date(e.getFullYear(),e.getMonth()+1,0);if(2!==t){var s=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return s&&i.setHours(this.firstDay(e).getHours()+s/60),this.findLastDay(i)}return this.findLastDay(this.firstDay(i))},t.prototype.checkDateValue=function(e){return!(0,i.isNullOrUndefined)(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+r):this.tableBodyElement.querySelectorAll("td:not(."+n+"):not(."+y+")");if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(v)){e=new Date(parseInt(t[i].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?(0,i.isNullOrUndefined)(this.element.querySelectorAll(".e-content table thead")[0])||(0,i.detach)(this.tableHeadElement):(0,i.isNullOrUndefined)(this.calendarElement.querySelectorAll(".e-content table thead")[0])||(0,i.detach)(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,s,a,r){var l,o=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),(0,i.removeClass)([this.contentElement,this.headerElement],[c,m,p]),(0,i.addClass)([this.contentElement,this.headerElement],[s]);for(var h=t,u=0,d=0;d<e.length/t;++d){for(l=this.createElement("tr"),u=0+u;u<h;u++)e[u].classList.contains("e-week-number")||(0,i.isNullOrUndefined)(e[u].children[0])||((0,i.addClass)([e[u].children[0]],[M]),(0,i.rippleEffect)(e[u].children[0],{duration:600,isCenterRipple:!0})),l.appendChild(e[u]),this.weekNumber&&7===u&&e[7].classList.contains(n)&&(0,i.addClass)([l],C),!this.weekNumber&&6===u&&e[6].classList.contains(n)&&(0,i.addClass)([l],C),this.weekNumber?41===u&&e[41].classList.contains(n)&&(0,i.addClass)([l],C):35===u&&e[35].classList.contains(n)&&(0,i.addClass)([l],C);h+=t,u+=0,this.tableBodyElement.appendChild(l)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(o!==this.getViewNumber(this.currentView())||0===o&&o!==this.getViewNumber(this.currentView()))&&this.navigateHandler(a),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(n)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)||2===s?this.contentClick(e,1,null,t):i.classList.contains(n)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.clickEventEmitter=function(e){e.preventDefault()},t.prototype.contentClick=function(e,t,s,a){var n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,s);switch(t){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?((0,i.detach)(this.tableBodyElement),this.currentDate=r,this.effect=V,this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(r.getMonth()),r.getMonth()>0&&this.currentDate.getMonth()!==r.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(r.getFullYear())):this.currentDate=r,this.effect=V,(0,i.detach)(this.tableBodyElement),this.renderMonths(e));break;case 1:if(n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,r,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(r.getFullYear());else{this.islamicPreviousHeader=this.headerElement.textContent;var l=this.islamicModule.getIslamicDate(r);this.currentDate=this.islamicModule.toGregorian(l.year,l.month,1)}this.effect=V,(0,i.detach)(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,s,a){switch(e){case 0:(0,i.detach)(this.tableBodyElement),this.renderMonths(t,null,a);break;case 1:(0,i.detach)(this.tableBodyElement),this.renderYears(t);break;case 2:(0,i.detach)(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),e},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(e,t,s,a){this.effect="";for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===l?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&(0,i.detach)(this.tableBodyElement),this.minMaxUpdate(),s&&this.validateValues(s,a),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?((0,i.detach)(this.todayElement),(0,i.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&((0,i.removeClass)([this.todayElement],v),(0,i.detach)(this.todayElement),(0,i.detach)(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody());break;case"locale":if(this.globalize=new i.Internationalization(this.locale),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()){this.l10=new i.L10n(this.getModuleName(),{today:"Today"},this.locale)}this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():(0,i.isNullOrUndefined)(this.todayElement)||(0,i.isNullOrUndefined)(this.footer)||((0,i.detach)(this.todayElement),(0,i.detach)(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!(0,i.isNullOrUndefined)(t)&&t.length>0){for(var s=this.copyValues(t),a=0;a<s.length;a++){var n=s[a],r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=void 0;l="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(n,{type:"dateTime",skeleton:"full",calendar:"islamic"});var o={type:"date",skeleton:"yMd",calendar:r},h=this.globalize.formatDate(this.min,o),u={type:"date",skeleton:"yMd",calendar:r},d=this.globalize.formatDate(this.max,u);(+new Date(l)<+new Date(h)||+new Date(l)>+new Date(d))&&(s.splice(a,1),a=-1)}this.setProperties({values:s},!0)}},t.prototype.setValueUpdate=function(){(0,i.isNullOrUndefined)(this.tableBodyElement)||((0,i.detach)(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!(0,i.isNullOrUndefined)(e)&&e.length>0)for(var s=0;s<e.length;s++)t.push(new Date(+e[s]));return t},t.prototype.titleUpdate=function(e,t){var s,a,n=new i.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(s=n.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:r}),a=n.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:r})):(s=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:r}),a=n.formatDate(e,{type:"dateTime",format:"y",calendar:r})),t){case"days":this.headerTitleElement.textContent=this.toCapitalize(s);break;case"months":this.headerTitleElement.textContent=a}},t.prototype.setActiveDescendant=function(){var e,t,s=this.tableBodyElement.querySelector("tr td.e-focused-date"),a=this.tableBodyElement.querySelector("tr td.e-selected"),n="Gregorian"===this.calendarMode?"gregorian":"islamic",r=this.currentView();return t="Month"===r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:n}):"Year"===r?"islamic"!==n?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:n}),(a||s)&&((0,i.isNullOrUndefined)(a)||a.setAttribute("aria-selected","true"),(s||a).setAttribute("aria-label",t),e=(s||a).getAttribute("id")),e},t.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},t.prototype.destroy=function(){("calendar"===this.getModuleName()&&this.element||this.calendarElement&&this.element)&&(0,i.removeClass)([this.element],[h]),"calendar"===this.getModuleName()&&this.element&&((0,i.isNullOrUndefined)(this.headerTitleElement)||i.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&i.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),(0,i.isNullOrUndefined)(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),this.todayElement=null,this.tableBodyElement=null,this.todayButtonEvent=null,this.renderDayCellArgs=null,this.headerElement=null,this.nextIcon=null,this.table=null,this.tableHeadElement=null,this.previousIcon=null,this.headerTitleElement=null,this.footer=null,this.contentElement=null,e.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=V,this.switchView(++t,e)},t.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},t.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e)},t.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},t.prototype.navigatePrevious=function(e){!i.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e)},t.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},t.prototype.navigateNext=function(e){!i.Browser.isDevice&&e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e)},t.prototype.navigateTo=function(e,t,i){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,i)},t.prototype.currentView=function(){return!(0,i.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains(p)?"Year":!(0,i.isNullOrUndefined)(this.contentElement)&&this.contentElement.classList.contains(m)?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!(0,i.isNullOrUndefined)(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var s=(0,i.isNullOrUndefined)(this.dayHeaderFormat)?null:".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),a=(0,i.isNullOrUndefined)(this.dayHeaderFormat)?null:".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?(0,i.getValue)("main."+this.locale+s,e):(0,i.getValue)("main."+this.locale+a,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),i=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-i+O)/O/7)},t.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),s=new Date(e.getTime()+t),a=s.getTimezoneOffset()-i;e.setTime(s.getTime()+6e4*a)},t.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year,s.month+t,1)}},t.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year+t,s.month,1)}},t.prototype.getIdValue=function(e,t){var i;i=e?e.currentTarget:t;var s={type:"dateTime",skeleton:"full",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},a=this.globalize.formatDate(new Date(parseInt(""+i.getAttribute("id"),0)),s),n=this.globalize.parseDate(a,s),r=n.valueOf()-n.valueOf()%1e3;return new Date(r)},t.prototype.adjustLongHeaderSize=function(){(0,i.removeClass)([this.element],N),"Wide"===this.dayHeaderFormat&&(0,i.addClass)(["calendar"===this.getModuleName()?this.element:this.calendarElement],N)},t.prototype.selectDate=function(e,t,s,a,n){var r=s||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,t.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,t);else{if(a&&!this.checkPresentDate(t,n)){var l=this.copyValues(n);!(0,i.isNullOrUndefined)(n)&&l.length>0?(l.push(new Date(this.checkValue(t))),this.setProperties({values:l},!0),this.setProperties({value:n[n.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)}else this.setProperties({value:new Date(this.checkValue(t))},!0);this.currentDate=new Date(this.checkValue(t))}var o=(0,i.closest)(r,"."+h);if((0,i.isNullOrUndefined)(o)&&(o=this.tableBodyElement),a||(0,i.isNullOrUndefined)(o.querySelector("."+b))||(0,i.removeClass)([o.querySelector("."+b)],b),a||(0,i.isNullOrUndefined)(o.querySelector("."+D))||(0,i.removeClass)([o.querySelector("."+D)],D),a||(0,i.isNullOrUndefined)(o.querySelector("."+E))||(0,i.removeClass)([o.querySelector("."+E)],E),a){l=this.copyValues(n);for(var u=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),d=0;d<u.length;d++){var p=o.querySelectorAll("td."+D)[0],c=o.querySelectorAll("td."+b)[0];u[d]===p&&(0,i.removeClass)([u[d]],D),u[d]!==c||this.checkPresentDate(new Date(parseInt(c.getAttribute("id").split("_")[0],10)),n)||(0,i.removeClass)([u[d]],b)}if(r.classList.contains(b)){(0,i.removeClass)([r],b);for(var m=0;m<l.length;m++){var f={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(t,f)===this.globalize.formatDate(l[m],f)){d=l.indexOf(l[m]);l.splice(d,1),(0,i.addClass)([r],D)}}this.setProperties({values:l},!0)}else(0,i.addClass)([r],b)}else(0,i.addClass)([r],b);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var s=!1;if(!(0,i.isNullOrUndefined)(t))for(var a=0;a<t.length;a++){var n="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:n})===this.globalize.formatDate(t[a],{format:null,type:"date",skeleton:"short",calendar:n})&&(s=!0)}return s},t.prototype.setAriaActiveDescendant=function(){(0,i.attributes)(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?(0,i.isNullOrUndefined)(this.previousIcon)||(i.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),(0,i.addClass)([this.previousIcon],""+v),(0,i.addClass)([this.previousIcon],""+g),this.previousIcon.setAttribute("aria-disabled","true")):(i.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),(0,i.removeClass)([this.previousIcon],""+v),(0,i.removeClass)([this.previousIcon],""+g),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){(0,i.extend)(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){(0,i.extend)(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},t.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},t.prototype.nextIconHandler=function(e){e?(0,i.isNullOrUndefined)(this.previousIcon)||(i.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),(0,i.addClass)([this.nextIcon],v),(0,i.addClass)([this.nextIcon],g),this.nextIcon.setAttribute("aria-disabled","true")):(i.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),(0,i.removeClass)([this.nextIcon],v),(0,i.removeClass)([this.nextIcon],g),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,i){var s,a,n=t.getFullYear();return s=n,a=0,i&&(s=(n-=n%i)-n%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<n&&(a=-1),a},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).year},t.prototype.compareYear=function(e,t){return this.compare(e,t,0)},t.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},t.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},t.prototype.addDay=function(e,t,s,a,n){var r=t,l=new Date(+e);if(!(0,i.isNullOrUndefined)(this.tableBodyElement)&&!(0,i.isNullOrUndefined)(s)){for(;this.findNextTD(new Date(+e),r,a,n);)r+=t;var o=new Date(l.setDate(l.getDate()+r));r=+o>+a||+o<+n?r===t?t-t:t:r}e.setDate(e.getDate()+r)},t.prototype.findNextTD=function(e,t,s,a){var n=new Date(e.setDate(e.getDate()+t)),r=[],l=!1;if((!(0,i.isNullOrUndefined)(n)&&n.getMonth())===(!(0,i.isNullOrUndefined)(this.currentDate)&&this.currentDate.getMonth())){r=("Gregorian"===this.calendarMode?this.renderDays(n):this.islamicModule.islamicRenderDays(this.currentDate,n)).filter((function(e){return e.classList.contains(v)}))}else r=this.tableBodyElement.querySelectorAll("td."+v);if(+n<=+s&&+n>=+a&&r.length)for(var o=0;o<r.length&&!(l=+n==+new Date(parseInt(r[o].id,0)));o++);return l},t.prototype.getMaxDays=function(e){var t,i=new Date(this.checkValue(e));t=28;for(var s=i.getMonth();i.getMonth()===s;)++t,i.setDate(t);return t-1},t.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.compareMonth=function(e,t){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},t.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},t.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},t.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},a([(0,i.Property)(new Date(1900,0,1))],t.prototype,"min",void 0),a([(0,i.Property)(!0)],t.prototype,"enabled",void 0),a([(0,i.Property)(null)],t.prototype,"cssClass",void 0),a([(0,i.Property)(new Date(2099,11,31))],t.prototype,"max",void 0),a([(0,i.Property)(null)],t.prototype,"firstDayOfWeek",void 0),a([(0,i.Property)("Gregorian")],t.prototype,"calendarMode",void 0),a([(0,i.Property)("Month")],t.prototype,"start",void 0),a([(0,i.Property)("Month")],t.prototype,"depth",void 0),a([(0,i.Property)(!1)],t.prototype,"weekNumber",void 0),a([(0,i.Property)("FirstDay")],t.prototype,"weekRule",void 0),a([(0,i.Property)(!0)],t.prototype,"showTodayButton",void 0),a([(0,i.Property)("Short")],t.prototype,"dayHeaderFormat",void 0),a([(0,i.Property)(!1)],t.prototype,"enablePersistence",void 0),a([(0,i.Property)(null)],t.prototype,"keyConf