mydaterangepicker
Version:
Angular date range picker
1 lines • 49.7 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms","@angular/common"],t):t(e.mydaterangepicker=e.mydaterangepicker||{},e.ng.core,e.ng.forms,e.ng.common)}(this,function(e,t,a,s){"use strict";var A,r=function(){function e(){}return e.prototype.isDateRangeValid=function(e,t,a,s,A,r,i,n,o,l){var d={beginDate:{day:0,month:0,year:0},endDate:{day:0,month:0,year:0}},h=-1!==t.indexOf("mmm");if(23!==e.length&&!h||25!==e.length&&h)return d;var p=e.split(" - ");if(2!==p.length)return d;var y=[];for(var c in p){var b=this.isDateValid(p[c],t,a,s,l,h);if(0===b.day&&0===b.month&&0===b.year)return d;if(this.isDisabledDay(b,a,s,A,r,i,n,o))return d;y.push(b)}return this.getTimeInMilliseconds(y[1])<this.getTimeInMilliseconds(y[0])?d:{beginDate:{day:y[0].day,month:y[0].month,year:y[0].year},endDate:{day:y[1].day,month:y[1].month,year:y[1].year}}},e.prototype.isMonthLabelValid=function(e,t){for(var a=1;a<=12;a++)if(e.toLowerCase()===t[a].toLowerCase())return a;return-1},e.prototype.isYearLabelValid=function(e,t,a){return e>=t&&e<=a?e:-1},e.prototype.parseDatePartNumber=function(e,t,a){var s=e.indexOf(a);if(-1!==s){var A=t.substring(s,s+a.length);return/^\d+$/.test(A)?parseInt(A):-1}return-1},e.prototype.parseDatePartMonthName=function(e,t,a,s){var A=e.indexOf(a);return-1!==A?this.isMonthLabelValid(t.substring(A,A+a.length),s):-1},e.prototype.parseDefaultMonth=function(e){var t={monthTxt:"",monthNbr:0,year:0};if(""!==e){var a=e.split(e.match(/[^0-9]/)[0]);t.monthNbr=2===a[0].length?parseInt(a[0]):parseInt(a[1]),t.year=2===a[0].length?parseInt(a[1]):parseInt(a[0])}return t},e.prototype.isDisabledDay=function(e,t,a,s,A,r,i,n){for(var o=this.getTimeInMilliseconds(e),l=0,d=n;l<d.length;l++)if((b=d[l]).year===e.year&&b.month===e.month&&b.day===e.day)return!1;if(e.year<t&&12===e.month||e.year>a&&1===e.month)return!0;if(this.isInitializedDate(s)&&o<=this.getTimeInMilliseconds(s))return!0;if(this.isInitializedDate(A)&&o>=this.getTimeInMilliseconds(A))return!0;for(var h=0,p=r;h<p.length;h++)if((b=p[h]).year===e.year&&b.month===e.month&&b.day===e.day)return!0;for(var y=0,c=i;y<c.length;y++){var b=c[y];if(this.isInitializedDate(b.beginDate)&&this.isInitializedDate(b.endDate)&&o>=this.getTimeInMilliseconds(b.beginDate)&&o<=this.getTimeInMilliseconds(b.endDate))return!0}return!1},e.prototype.isMonthDisabledByDisableUntil=function(e,t){return this.isInitializedDate(t)&&this.getTimeInMilliseconds(e)<=this.getTimeInMilliseconds(t)},e.prototype.isMonthDisabledByDisableSince=function(e,t){return this.isInitializedDate(t)&&this.getTimeInMilliseconds(e)>=this.getTimeInMilliseconds(t)},e.prototype.isInitializedDate=function(e){return 0!==e.year&&0!==e.month&&0!==e.day},e.prototype.getTimeInMilliseconds=function(e){return new Date(e.year,e.month-1,e.day,0,0,0,0).getTime()},e.prototype.getWeekNumber=function(e){var t=new Date(e.year,e.month-1,e.day,0,0,0,0);return t.setDate(t.getDate()+(0===t.getDay()?-3:4-t.getDay())),Math.round((t.getTime()-new Date(t.getFullYear(),0,4).getTime())/864e5/7)+1},e.prototype.isDateValid=function(e,t,a,s,A,r){var i=[31,28,31,30,31,30,31,31,30,31,30,31],n={day:0,month:0,year:0};if(10!==e.length&&!r||11!==e.length&&r)return n;var o=t.replace(/[dmy]/g,"")[0];if(3!==e.split(o).length)return n;var l=this.parseDatePartNumber(t,e,"dd"),d=r?this.parseDatePartMonthName(t,e,"mmm",A):this.parseDatePartNumber(t,e,"mm"),h=this.parseDatePartNumber(t,e,"yyyy");return-1!==l&&-1!==d&&-1!==h?h<a||h>s||d<1||d>12?n:((h%400==0||h%100!=0&&h%4==0)&&(i[1]=29),l<1||l>i[d-1]?n:{day:l,month:d,year:h}):n},e.decorators=[{type:t.Injectable}],e.ctorParameters=[],e}(),i=function(){function e(e,t){this.el=e,this.renderer=t}return e.prototype.ngAfterViewInit=function(){"0"!==this.value&&this.renderer.invokeElementMethod(this.el.nativeElement,"focus",[])},e.decorators=[{type:t.Directive,args:[{selector:"[mydrpfocus]"}]}],e.ctorParameters=[{type:t.ElementRef},{type:t.Renderer}],e.propDecorators={value:[{type:t.Input,args:["mydrpfocus"]}]},e}(),n={provide:a.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return h}),multi:!0};!function(e){e[e.min=1100]="min",e[e.max=9100]="max"}(A||(A={}));var o;!function(e){e[e.focus=1]="focus",e[e.blur=2]="blur"}(o||(o={}));var l;!function(e){e[e.enter=13]="enter",e[e.esc=27]="esc",e[e.space=32]="space"}(l||(l={}));var d;!function(e){e[e.prev=1]="prev",e[e.curr=2]="curr",e[e.next=3]="next"}(d||(d={}));var h=function(){function e(e,a,s,r){var i=this;this.elem=e,this.renderer=a,this.cdr=s,this.drus=r,this.dateRangeChanged=new t.EventEmitter,this.inputFieldChanged=new t.EventEmitter,this.calendarViewChanged=new t.EventEmitter,this.inputFocusBlur=new t.EventEmitter,this.dateSelected=new t.EventEmitter,this.onChangeCb=function(){},this.onTouchedCb=function(){},this.showSelector=!1,this.visibleMonth={monthTxt:"",monthNbr:0,year:0},this.selectedMonth={monthTxt:"",monthNbr:0,year:0},this.weekDays=[],this.dates=[],this.months=[],this.years=[],this.selectionDayTxt="",this.invalidDateRange=!1,this.dateRangeFormat="",this.dayIdx=0,this.weekDayOpts=["su","mo","tu","we","th","fr","sa"],this.selectMonth=!1,this.selectYear=!1,this.prevMonthDisabled=!1,this.nextMonthDisabled=!1,this.prevYearDisabled=!1,this.nextYearDisabled=!1,this.prevYearsDisabled=!1,this.nextYearsDisabled=!1,this.prevMonthId=d.prev,this.currMonthId=d.curr,this.nextMonthId=d.next,this.beginDate={year:0,month:0,day:0},this.endDate={year:0,month:0,day:0},this.titleAreaText="",this.opts={dayLabels:{su:"Sun",mo:"Mon",tu:"Tue",we:"Wed",th:"Thu",fr:"Fri",sa:"Sat"},monthLabels:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},dateFormat:"yyyy-mm-dd",showClearBtn:!0,showApplyBtn:!0,showSelectDateText:!0,selectBeginDateTxt:"Select Begin Date",selectEndDateTxt:"Select End Date",firstDayOfWeek:"mo",sunHighlight:!0,markCurrentDay:!0,markCurrentMonth:!0,markCurrentYear:!0,height:"34px",width:"262px",selectorHeight:"232px",selectorWidth:"252px",inline:!1,showClearDateRangeBtn:!0,selectionTxtFontSize:"14px",alignSelectorRight:!1,indicateInvalidDateRange:!0,editableDateRangeField:!0,monthSelector:!0,yearSelector:!0,disableHeaderButtons:!0,showWeekNumbers:!1,minYear:A.min,maxYear:A.max,disableUntil:{year:0,month:0,day:0},disableSince:{year:0,month:0,day:0},disableDates:[],enableDates:[],disableDateRanges:[],componentDisabled:!1,showSelectorArrow:!0,openSelectorOnInputClick:!1,ariaLabelInputField:"Date range input field",ariaLabelClearDateRange:"Clear date range",ariaLabelOpenCalendar:"Open Calendar",ariaLabelPrevMonth:"Previous Month",ariaLabelNextMonth:"Next Month",ariaLabelPrevYear:"Previous Year",ariaLabelNextYear:"Next Year"},this.globalListener=a.listenGlobal("document","click",function(e){i.showSelector&&e.target&&i.elem.nativeElement!==e.target&&!i.elem.nativeElement.contains(e.target)&&(i.showSelector=!1),(i.opts.monthSelector||i.opts.yearSelector)&&i.resetMonthYearSelect()})}return e.prototype.resetMonthYearSelect=function(){this.selectMonth=!1,this.selectYear=!1},e.prototype.onSelectMonthClicked=function(e){if(e.stopPropagation(),this.selectMonth=!this.selectMonth,this.selectYear=!1,this.cdr.detectChanges(),this.selectMonth){var t=this.getToday();this.months.length=0;for(var a=1;a<=12;a+=3){for(var s=[],A=a;A<a+3;A++){var r=this.drus.isMonthDisabledByDisableUntil({year:this.visibleMonth.year,month:A,day:this.daysInMonth(A,this.visibleMonth.year)},this.opts.disableUntil)||this.drus.isMonthDisabledByDisableSince({year:this.visibleMonth.year,month:A,day:1},this.opts.disableSince);s.push({nbr:A,name:this.opts.monthLabels[A],currMonth:A===t.month&&this.visibleMonth.year===t.year,selected:A===this.visibleMonth.monthNbr,disabled:r})}this.months.push(s)}}},e.prototype.onMonthCellClicked=function(e){var t=e.nbr!==this.visibleMonth.monthNbr;this.visibleMonth={monthTxt:this.monthText(e.nbr),monthNbr:e.nbr,year:this.visibleMonth.year},this.generateCalendar(e.nbr,this.visibleMonth.year,t),this.selectMonth=!1,this.selectorEl.nativeElement.focus()},e.prototype.onMonthCellKeyDown=function(e,t){e.keyCode!==l.enter&&e.keyCode!==l.space||t.disabled||(e.preventDefault(),this.onMonthCellClicked(t))},e.prototype.onSelectYearClicked=function(e){e.stopPropagation(),this.selectYear=!this.selectYear,this.selectMonth=!1,this.cdr.detectChanges(),this.selectYear&&this.generateYears(this.visibleMonth.year)},e.prototype.onYearCellClicked=function(e){var t=e.year!==this.visibleMonth.year;this.visibleMonth={monthTxt:this.visibleMonth.monthTxt,monthNbr:this.visibleMonth.monthNbr,year:e.year},this.generateCalendar(this.visibleMonth.monthNbr,e.year,t),this.selectYear=!1,this.selectorEl.nativeElement.focus()},e.prototype.onYearCellKeyDown=function(e,t){e.keyCode!==l.enter&&e.keyCode!==l.space||t.disabled||(e.preventDefault(),this.onYearCellClicked(t))},e.prototype.onPrevYears=function(e,t){e.stopPropagation(),this.generateYears(t-25)},e.prototype.onNextYears=function(e,t){e.stopPropagation(),this.generateYears(t+25)},e.prototype.generateYears=function(e){this.years.length=0;for(var t=this.getToday(),a=e;a<=20+e;a+=5){for(var s=[],A=a;A<a+5;A++){var r=this.drus.isMonthDisabledByDisableUntil({year:A,month:this.visibleMonth.monthNbr,day:this.daysInMonth(this.visibleMonth.monthNbr,A)},this.opts.disableUntil)||this.drus.isMonthDisabledByDisableSince({year:A,month:this.visibleMonth.monthNbr,day:1},this.opts.disableSince),i=A<this.opts.minYear||A>this.opts.maxYear;s.push({year:A,currYear:A===t.year,selected:A===this.visibleMonth.year,disabled:r||i})}this.years.push(s)}this.prevYearsDisabled=this.years[0][0].year<=this.opts.minYear||this.drus.isMonthDisabledByDisableUntil({year:this.years[0][0].year-1,month:this.visibleMonth.monthNbr,day:this.daysInMonth(this.visibleMonth.monthNbr,this.years[0][0].year-1)},this.opts.disableUntil),this.nextYearsDisabled=this.years[4][4].year>=this.opts.maxYear||this.drus.isMonthDisabledByDisableSince({year:this.years[4][4].year+1,month:this.visibleMonth.monthNbr,day:1},this.opts.disableSince)},e.prototype.onUserDateRangeInput=function(e){if(this.invalidDateRange=!1,0===e.length)this.drus.isInitializedDate(this.beginDate)&&this.drus.isInitializedDate(this.endDate)?this.clearDateRange():this.inputFieldChanged.emit({value:e,dateRangeFormat:this.dateRangeFormat,valid:!1});else{var t=this.drus.isDateRangeValid(e,this.opts.dateFormat,this.opts.minYear,this.opts.maxYear,this.opts.disableUntil,this.opts.disableSince,this.opts.disableDates,this.opts.disableDateRanges,this.opts.enableDates,this.opts.monthLabels);this.drus.isInitializedDate(t.beginDate)&&this.drus.isInitializedDate(t.endDate)?(this.beginDate=t.beginDate,this.endDate=t.endDate,this.rangeSelected()):(this.invalidDateRange=!0,this.onChangeCb(null),this.onTouchedCb(),this.inputFieldChanged.emit({value:e,dateRangeFormat:this.dateRangeFormat,valid:!1}))}},e.prototype.onFocusInput=function(e){this.inputFocusBlur.emit({reason:o.focus,value:e.target.value})},e.prototype.onBlurInput=function(e){this.selectionDayTxt=e.target.value,this.onTouchedCb(),this.inputFocusBlur.emit({reason:o.blur,value:e.target.value})},e.prototype.onCloseSelector=function(e){e.keyCode===l.esc&&this.showSelector&&!this.opts.inline&&(this.showSelector=!1)},e.prototype.parseOptions=function(){var e=this;if(void 0!==this.options&&Object.keys(this.options).forEach(function(t){e.opts[t]=e.options[t]}),this.opts.minYear<A.min&&(this.opts.minYear=A.min),this.opts.maxYear>A.max&&(this.opts.maxYear=A.max),this.dateRangeFormat=this.opts.dateFormat+" - "+this.opts.dateFormat,this.dayIdx=this.weekDayOpts.indexOf(this.opts.firstDayOfWeek),-1!==this.dayIdx)for(var t=this.dayIdx,a=0;a<this.weekDayOpts.length;a++)this.weekDays.push(this.opts.dayLabels[this.weekDayOpts[t]]),t="sa"===this.weekDayOpts[t]?0:t+1},e.prototype.writeValue=function(e){if(e&&e.beginDate&&e.endDate){this.beginDate=this.parseSelectedDate(e.beginDate),this.endDate=this.parseSelectedDate(e.endDate);var t=this.formatDate(this.beginDate),a=this.formatDate(this.endDate);this.selectionDayTxt=t+" - "+a,this.titleAreaText=this.selectionDayTxt,this.inputFieldChanged.emit({value:this.selectionDayTxt,dateRangeFormat:this.dateRangeFormat,valid:!0})}else null!==e&&""!==e||(this.clearRangeValues(),this.inputFieldChanged.emit({value:"",dateRangeFormat:this.dateRangeFormat,valid:!1}));this.invalidDateRange=!1},e.prototype.setDisabledState=function(e){this.opts.componentDisabled=e},e.prototype.registerOnChange=function(e){this.onChangeCb=e},e.prototype.registerOnTouched=function(e){this.onTouchedCb=e},e.prototype.ngOnDestroy=function(){this.globalListener()},e.prototype.ngOnChanges=function(e){var t=this;e.hasOwnProperty("placeholder")&&(this.placeholder=e.placeholder.currentValue),e.hasOwnProperty("options")&&(this.options=e.options.currentValue,this.weekDays.length=0,this.parseOptions());var a=!1;if(e.hasOwnProperty("defaultMonth")){var s=e.defaultMonth.currentValue;"object"==typeof s&&(s=s.defMonth),this.selectedMonth=null!==s&&void 0!==s&&""!==s?this.parseSelectedMonth(s):{monthTxt:"",monthNbr:0,year:0},a=!0}if(e.hasOwnProperty("selDateRange")){var A=e.selDateRange;if(null!==A.currentValue&&void 0!==A.currentValue&&""!==A.currentValue){if("string"==typeof A.currentValue){var r=A.currentValue.split(" - ");this.beginDate=this.parseSelectedDate(r[0]),this.endDate=this.parseSelectedDate(r[1]),this.selectionDayTxt=A.currentValue}else"object"==typeof A.currentValue&&(this.beginDate=this.parseSelectedDate(A.currentValue.beginDate),this.endDate=this.parseSelectedDate(A.currentValue.endDate),this.selectionDayTxt=this.formatDate(this.beginDate)+" - "+this.formatDate(this.endDate));this.titleAreaText=this.selectionDayTxt,setTimeout(function(){t.onChangeCb(t.getDateRangeModel(t.beginDate,t.endDate))}),this.toBeginDate()}else A.isFirstChange()||this.clearDateRange()}0===this.visibleMonth.year&&0===this.visibleMonth.monthNbr||a?this.setVisibleMonth():(this.visibleMonth.monthTxt=this.opts.monthLabels[this.visibleMonth.monthNbr],this.generateCalendar(this.visibleMonth.monthNbr,this.visibleMonth.year,!1))},e.prototype.removeBtnClicked=function(){this.clearDateRange()},e.prototype.openBtnClicked=function(){this.showSelector=!this.showSelector,this.cdr.detectChanges(),this.showSelector&&this.setVisibleMonth()},e.prototype.setVisibleMonth=function(){if(this.drus.isInitializedDate(this.beginDate))this.toBeginDate();else{var e=0,t=0;if(0===this.selectedMonth.year&&0===this.selectedMonth.monthNbr){var a=this.getToday();e=a.year,t=a.month}else e=this.selectedMonth.year,t=this.selectedMonth.monthNbr;this.visibleMonth={monthTxt:this.opts.monthLabels[t],monthNbr:t,year:e},this.generateCalendar(t,e,!0)}},e.prototype.onPrevMonth=function(){var e=this.getDate({year:this.visibleMonth.year,month:this.visibleMonth.monthNbr,day:1});e.setMonth(e.getMonth()-1);var t=e.getFullYear(),a=e.getMonth()+1;this.visibleMonth={monthTxt:this.monthText(a),monthNbr:a,year:t},this.generateCalendar(a,t,!0)},e.prototype.onNextMonth=function(){var e=this.getDate({year:this.visibleMonth.year,month:this.visibleMonth.monthNbr,day:1});e.setMonth(e.getMonth()+1);var t=e.getFullYear(),a=e.getMonth()+1;this.visibleMonth={monthTxt:this.monthText(a),monthNbr:a,year:t},this.generateCalendar(a,t,!0)},e.prototype.onPrevYear=function(){this.visibleMonth.year-1<this.opts.minYear||(this.visibleMonth.year--,this.generateCalendar(this.visibleMonth.monthNbr,this.visibleMonth.year,!0))},e.prototype.onNextYear=function(){this.visibleMonth.year+1>this.opts.maxYear||(this.visibleMonth.year++,this.generateCalendar(this.visibleMonth.monthNbr,this.visibleMonth.year,!0))},e.prototype.clearRangeValues=function(){this.invalidDateRange=!1,this.selectionDayTxt="",this.beginDate={year:0,month:0,day:0},this.endDate={year:0,month:0,day:0},this.titleAreaText=this.opts.selectBeginDateTxt,this.generateCalendar(this.visibleMonth.monthNbr,this.visibleMonth.year,!1)},e.prototype.onCellClicked=function(e){var t=this.drus.isInitializedDate(this.beginDate),a=this.drus.isInitializedDate(this.endDate);a&&(this.beginDate={year:0,month:0,day:0},this.endDate={year:0,month:0,day:0},this.titleAreaText=this.opts.selectBeginDateTxt,t=!1,a=!1),a||(!t||t&&this.drus.getTimeInMilliseconds(e.dateObj)<this.drus.getTimeInMilliseconds(this.beginDate)?(this.selectBeginDate(e.dateObj),this.titleAreaText=this.formatDate(e.dateObj)+" - "+this.opts.selectEndDateTxt):this.drus.getTimeInMilliseconds(e.dateObj)>=this.drus.getTimeInMilliseconds(this.beginDate)&&(this.selectEndDate(e.dateObj),this.rangeSelected(),this.titleAreaText=this.formatDate(this.beginDate)+" - "+this.formatDate(e.dateObj)))},e.prototype.selectBeginDate=function(e){this.beginDate=e;var t=this.formatDate(e);this.titleAreaText=t+" - "+this.opts.selectEndDateTxt,this.dateSelected.emit({type:1,date:e,formatted:t,jsdate:this.getDate(e)})},e.prototype.selectEndDate=function(e){this.endDate=e;var t=this.formatDate(e);this.titleAreaText=this.formatDate(this.beginDate)+" - "+t,this.dateSelected.emit({type:2,date:e,formatted:t,jsdate:this.getDate(e)})},e.prototype.onCellKeyDown=function(e,t){e.keyCode!==l.enter&&e.keyCode!==l.space||t.disabled||(e.preventDefault(),this.onCellClicked(t))},e.prototype.onCellMouseEnter=function(e){if(this.drus.isInitializedDate(this.beginDate)&&!this.drus.isInitializedDate(this.endDate))for(var t=0,a=this.dates;t<a.length;t++)for(var s=0,A=a[t].week;s<A.length;s++){var r=A[s];r.range=this.drus.getTimeInMilliseconds(r.dateObj)>=this.drus.getTimeInMilliseconds(this.beginDate)&&this.drus.getTimeInMilliseconds(r.dateObj)<=this.drus.getTimeInMilliseconds(e.dateObj)}},e.prototype.onCellMouseLeave=function(){for(var e=0,t=this.dates;e<t.length;e++)for(var a=0,s=t[e].week;a<s.length;a++)s[a].range=!1},e.prototype.toBeginDate=function(){var e=this.beginDate.year!==this.visibleMonth.year||this.beginDate.month!==this.visibleMonth.monthNbr;this.visibleMonth={monthTxt:this.monthText(this.beginDate.month),monthNbr:this.beginDate.month,year:this.beginDate.year},this.generateCalendar(this.beginDate.month,this.beginDate.year,e)},e.prototype.clearDateRange=function(){this.drus.isInitializedDate(this.endDate)&&(this.dateRangeChanged.emit({beginDate:{year:0,month:0,day:0},beginJsDate:null,endDate:{year:0,month:0,day:0},endJsDate:null,formatted:"",beginEpoc:0,endEpoc:0}),""!==this.selectionDayTxt&&this.inputFieldChanged.emit({value:"",dateRangeFormat:this.dateRangeFormat,valid:!1}),this.onChangeCb(null),this.onTouchedCb()),this.clearRangeValues()},e.prototype.rangeSelected=function(){var e=this.getDateRangeModel(this.beginDate,this.endDate);this.selectionDayTxt=this.formatDate(this.beginDate)+" - "+this.formatDate(this.endDate),this.showSelector=!1,this.dateRangeChanged.emit(e),this.inputFieldChanged.emit({value:this.selectionDayTxt,dateRangeFormat:this.dateRangeFormat,valid:!0}),this.onChangeCb(e),this.onTouchedCb(),this.invalidDateRange=!1,(this.opts.monthSelector||this.opts.yearSelector)&&this.resetMonthYearSelect()},e.prototype.getDateRangeModel=function(e,t){var a=this.drus.getTimeInMilliseconds(e)/1e3,s=this.drus.getTimeInMilliseconds(t)/1e3;return{beginDate:e,beginJsDate:this.getDate(e),endDate:t,endJsDate:this.getDate(t),formatted:this.formatDate(e)+" - "+this.formatDate(t),beginEpoc:a,endEpoc:s}},e.prototype.isInRange=function(e){if(!this.drus.isInitializedDate(this.beginDate)||!this.drus.isInitializedDate(this.endDate))return!1;var t=this.drus.getTimeInMilliseconds(e.dateObj);return t>=this.drus.getTimeInMilliseconds(this.beginDate)&&t<=this.drus.getTimeInMilliseconds(this.endDate)},e.prototype.isRangeSelected=function(){return!(!this.drus.isInitializedDate(this.beginDate)||!this.drus.isInitializedDate(this.endDate))},e.prototype.preZero=function(e){return parseInt(e)<10?"0"+e:e},e.prototype.formatDate=function(e){var t=this.opts.dateFormat.replace("yyyy",e.year).replace("dd",this.preZero(e.day));return-1!==this.opts.dateFormat.indexOf("mmm")?t.replace("mmm",this.monthText(e.month)):t.replace("mm",this.preZero(e.month))},e.prototype.monthText=function(e){return this.opts.monthLabels[e]},e.prototype.monthStartIdx=function(e,t){var a=new Date;a.setDate(1),a.setMonth(t-1),a.setFullYear(e);var s=a.getDay()+this.sundayIdx();return s>=7?s-7:s},e.prototype.daysInMonth=function(e,t){return new Date(t,e,0).getDate()},e.prototype.daysInPrevMonth=function(e,t){var a=this.getDate({year:t,month:e,day:1});return a.setMonth(a.getMonth()-1),this.daysInMonth(a.getMonth()+1,a.getFullYear())},e.prototype.isCurrDay=function(e,t,a,s,A){return e===A.day&&t===A.month&&a===A.year&&s===this.currMonthId},e.prototype.getPreviousDate=function(e){var t=this.getDate(e);return t.setDate(t.getDate()-1),{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}},e.prototype.getNextDate=function(e){var t=this.getDate(e);return t.setDate(t.getDate()+1),{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}},e.prototype.getDayNumber=function(e){return this.getDate(e).getDay()},e.prototype.getWeekday=function(e){return this.weekDayOpts[this.getDayNumber(e)]},e.prototype.getDate=function(e){return new Date(e.year,e.month-1,e.day,0,0,0,0)},e.prototype.getToday=function(){var e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},e.prototype.sundayIdx=function(){return this.dayIdx>0?7-this.dayIdx:0},e.prototype.generateCalendar=function(e,t,a){this.dates.length=0;for(var s=this.getToday(),A=this.monthStartIdx(t,e),r=this.daysInMonth(e,t),i=this.daysInPrevMonth(e,t),n=1,o=this.prevMonthId,l=1;l<7;l++){var d=[];if(1===l){for(p=i-A+1;p<=i;p++){y={year:1===e?t-1:t,month:1===e?12:e-1,day:p};d.push({dateObj:y,cmo:o,currDay:this.isCurrDay(p,e,t,o,s),dayNbr:this.getDayNumber(y),disabled:this.drus.isDisabledDay(y,this.opts.minYear,this.opts.maxYear,this.opts.disableUntil,this.opts.disableSince,this.opts.disableDates,this.opts.disableDateRanges,this.opts.enableDates),range:!1})}o=this.currMonthId;for(var h=7-d.length,p=0;p<h;p++){y={year:t,month:e,day:n};d.push({dateObj:y,cmo:o,currDay:this.isCurrDay(n,e,t,o,s),dayNbr:this.getDayNumber(y),disabled:this.drus.isDisabledDay(y,this.opts.minYear,this.opts.maxYear,this.opts.disableUntil,this.opts.disableSince,this.opts.disableDates,this.opts.disableDateRanges,this.opts.enableDates),range:!1}),n++}}else for(p=1;p<8;p++){n>r&&(n=1,o=this.nextMonthId);var y={year:o===this.nextMonthId&&12===e?t+1:t,month:o===this.currMonthId?e:o===this.nextMonthId&&e<12?e+1:1,day:n};d.push({dateObj:y,cmo:o,currDay:this.isCurrDay(n,e,t,o,s),dayNbr:this.getDayNumber(y),disabled:this.drus.isDisabledDay(y,this.opts.minYear,this.opts.maxYear,this.opts.disableUntil,this.opts.disableSince,this.opts.disableDates,this.opts.disableDateRanges,this.opts.enableDates),range:!1}),n++}var c=this.opts.showWeekNumbers&&"mo"===this.opts.firstDayOfWeek?this.drus.getWeekNumber(d[0].dateObj):0;this.dates.push({week:d,weekNbr:c})}this.setHeaderBtnDisabledState(e,t),a&&this.calendarViewChanged.emit({year:t,month:e,first:{number:1,weekday:this.getWeekday({year:t,month:e,day:1})},last:{number:r,weekday:this.getWeekday({year:t,month:e,day:r})}})},e.prototype.setHeaderBtnDisabledState=function(e,t){var a=!1,s=!1,A=!1,r=!1;this.opts.disableHeaderButtons&&(a=this.drus.isMonthDisabledByDisableUntil({year:1===e?t-1:t,month:1===e?12:e-1,day:this.daysInMonth(1===e?12:e-1,1===e?t-1:t)},this.opts.disableUntil),s=this.drus.isMonthDisabledByDisableUntil({year:t-1,month:e,day:this.daysInMonth(e,t-1)},this.opts.disableUntil),A=this.drus.isMonthDisabledByDisableSince({year:12===e?t+1:t,month:12===e?1:e+1,day:1},this.opts.disableSince),r=this.drus.isMonthDisabledByDisableSince({year:t+1,month:e,day:1},this.opts.disableSince)),this.prevMonthDisabled=1===e&&t===this.opts.minYear||a,this.prevYearDisabled=t-1<this.opts.minYear||s,this.nextMonthDisabled=12===e&&t===this.opts.maxYear||A,this.nextYearDisabled=t+1>this.opts.maxYear||r},e.prototype.parseSelectedDate=function(e){var t={day:0,month:0,year:0};if("string"==typeof e){var a=e;t.day=this.drus.parseDatePartNumber(this.opts.dateFormat,a,"dd"),t.month=-1!==this.opts.dateFormat.indexOf("mmm")?this.drus.parseDatePartMonthName(this.opts.dateFormat,a,"mmm",this.opts.monthLabels):this.drus.parseDatePartNumber(this.opts.dateFormat,a,"mm"),t.year=this.drus.parseDatePartNumber(this.opts.dateFormat,a,"yyyy")}else"object"==typeof e&&(t=e);return t},e.prototype.parseSelectedMonth=function(e){return this.drus.parseDefaultMonth(e)},e.decorators=[{type:t.Component,args:[{selector:"my-date-range-picker",exportAs:"mydaterangepicker",styles:['.mydrp .monthcell,.mydrp .selection,.mydrp .weekdaytitle{overflow:hidden;white-space:nowrap}.mydrp{line-height:1;display:inline-block;position:relative}.mydrp *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;padding:0;margin:0}.mydrp,.mydrp .headertodaybtn,.mydrp .selection,.mydrp .selectiongroup,.mydrp .selector{border-radius:4px}.mydrp .header,.mydrp .titlearea,.mydrp .titleareatxt{border-radius:4px 4px 0 0}.mydrp .caltable,.mydrp .monthtable,.mydrp .yeartable{border-radius:0 0 4px 4px}.mydrp .caltable tbody tr:nth-child(6) td:first-child,.mydrp .monthtable tbody tr:nth-child(4) td:first-child,.mydrp .yeartable tbody tr:nth-child(7) td:first-child{border-bottom-left-radius:4px}.mydrp .caltable tbody tr:nth-child(6) td:last-child,.mydrp .monthtable tbody tr:nth-child(4) td:last-child,.mydrp .yeartable tbody tr:nth-child(7) td:last-child{border-bottom-right-radius:4px}.mydrp .btnpicker{border-radius:0 4px 4px 0}.mydrp .selector{margin-top:2px;margin-left:-1px;position:absolute;padding:0;border:1px solid #CCC;z-index:100;animation:selectorfadein 60ms}.mydrp .selector:focus{border:1px solid #ADD8E6;outline:0}@keyframes selectorfadein{from{opacity:0}to{opacity:1}}.mydrp .selectorarrow{background:#FFF;border:1px solid #CCC;margin-top:12px;padding:0}.mydrp .selectorarrow:after,.mydrp .selectorarrow:before{bottom:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute}.mydrp .selectorarrow:after{border-color:rgba(250,250,250,0);border-bottom-color:#FFF;border-width:10px;margin-left:-10px}.mydrp .selectorarrow:before{border-color:rgba(204,204,204,0);border-bottom-color:#CCC;border-width:11px;margin-left:-11px}.mydrp .selectorarrow:focus:before{border-bottom-color:#ADD8E6}.mydrp .selectorarrowleft:after,.mydrp .selectorarrowleft:before{left:24px}.mydrp .selectorarrowright:after,.mydrp .selectorarrowright:before{left:224px}.mydrp .alignselectorright{right:-1px}.mydrp .selectiongroup{position:relative;display:table;border:none;border-spacing:0;background-color:#FFF}.mydrp .selection{outline:0;background-color:#FFF;display:table-cell;position:absolute;width:100%;padding:0 64px 0 6px;text-overflow:ellipsis;border:none;color:#555}.mydrp .invaliddaterange{background-color:#F1DEDE}.mydrp ::-ms-clear{display:none}.mydrp .selbtngroup{position:relative;vertical-align:middle;white-space:nowrap;width:1%;display:table-cell;font-size:0}.mydrp .btnclear,.mydrp .btnpicker{height:100%;width:26px;border:none;padding:0;outline:0;font:inherit;-moz-user-select:none}.mydrp .headerclearbtn,.mydrp .headerokbtn{border-radius:2px;cursor:pointer;font-size:11px;height:20px;width:28px;outline:0}.mydrp .btnclearenabled,.mydrp .btnpickerenabled,.mydrp .headerbtnenabled,.mydrp .yearchangebtnenabled{cursor:pointer}.mydrp .btncleardisabled,.mydrp .btnpickerdisabled,.mydrp .clearbtndisabled,.mydrp .headerbtndisabled,.mydrp .okbtndisabled,.mydrp .selectiondisabled,.mydrp .yearchangebtndisabled{cursor:not-allowed;opacity:.65}.mydrp .selectiondisabled{background-color:#EEE}.mydrp .btnclear,.mydrp .btnpicker,.mydrp .headerclearbtn,.mydrp .headerokbtn{background:#FFF}.mydrp .header{width:100%;height:30px;background-color:#FFF}.mydrp .header td{vertical-align:middle;border:none;line-height:0}.mydrp .header td:nth-child(1){padding-left:4px}.mydrp .header td:nth-child(2){text-align:center}.mydrp .header td:nth-child(3){padding-right:4px}.mydrp .titlearea{text-align:center;background-color:#FFF}.mydrp .titleareatxt{height:24px;line-height:24px;font-size:12px;border-bottom:1px solid #EEE}.mydrp .inline{position:relative;margin-top:-1px}.mydrp .caltable,.mydrp .monthtable,.mydrp .yeartable{table-layout:fixed;width:100%;background-color:#FFF;font-size:14px}.mydrp .caltable,.mydrp .daycell,.mydrp .monthcell,.mydrp .monthtable,.mydrp .weekdaytitle,.mydrp .yearcell,.mydrp .yeartable{border-collapse:collapse;color:#036;line-height:1.1}.mydrp .daycell,.mydrp .monthcell,.mydrp .weekdaytitle,.mydrp .yearcell{padding:4px;text-align:center}.mydrp .weekdaytitle{background-color:#DDD;font-size:11px;font-weight:400;vertical-align:middle;max-width:36px}.mydrp .weekdaytitleweeknbr{width:20px;border-right:1px solid #BBB}.mydrp .monthcell{background-color:#FAFAFA}.mydrp .yearcell{background-color:#FAFAFA;width:20%}.mydrp .daycellweeknbr{font-size:10px;border-right:1px solid #CCC;cursor:default;color:#000}.mydrp .nextmonth,.mydrp .prevmonth{color:#444}.mydrp .disabled{cursor:default!important;color:#444!important;background:#FBEFEF!important}.mydrp .sunday{color:#C30000}.mydrp .sundayDim{opacity:.5}.mydrp .currmonth{background-color:#F6F6F6;font-weight:400}.mydrp .range{background-color:#D9F2E6}.mydrp .markcurrday,.mydrp .markcurrmonth,.mydrp .markcurryear{text-decoration:underline}.mydrp .datevalue{background-color:inherit}.mydrp .selecteddaybegin,.mydrp .selecteddayend,.mydrp .selectedmonth .monthvalue,.mydrp .selectedyear .yearvalue{border:none;background-color:#8EBFFF;border-radius:2px}.mydrp .headerbtncell{background-color:#FFF;cursor:pointer;display:table-cell;vertical-align:middle}.mydrp .yearchangebtncell{text-align:center;background-color:#FAFAFA}.mydrp .headerbtn,.mydrp .headerlabelbtn,.mydrp .yearchangebtn{background:#FFF;border:none;height:22px}.mydrp .headerbtn{width:16px}.mydrp .headerlabelbtn{font-size:14px;outline:0;cursor:default}.mydrp,.mydrp .headerclearbtn,.mydrp .headerokbtn{border:1px solid #CCC}.mydrp .btnclear,.mydrp .btnpicker,.mydrp .headerbtn,.mydrp .headerclearbtn,.mydrp .headermonthtxt,.mydrp .headerokbtn,.mydrp .headeryeartxt,.mydrp .yearchangebtn{color:#000}.mydrp button::-moz-focus-inner{border:0}.mydrp .headermonthtxt,.mydrp .headeryeartxt{text-align:center;display:table-cell;vertical-align:middle;font-size:14px;height:26px;width:40px;max-width:40px;overflow:hidden;white-space:nowrap}.mydrp .btnclear:focus,.mydrp .btnpicker:focus,.mydrp .headerclearbtn:focus,.mydrp .headerokbtn:focus{background:#ADD8E6}.mydrp .headerbtn:focus,.mydrp .monthlabel:focus,.mydrp .yearchangebtn:focus,.mydrp .yearlabel:focus{color:#ADD8E6;outline:0}.mydrp .daycell:focus,.mydrp .monthcell:focus,.mydrp .yearcell:focus{outline:#CCC solid 1px}.mydrp .icon-mydrpcalendar,.mydrp .icon-mydrpok,.mydrp .icon-mydrpremove{font-size:16px}.mydrp .icon-mydrpdown,.mydrp .icon-mydrpleft,.mydrp .icon-mydrpright,.mydrp .icon-mydrpup{color:#222;font-size:20px}.mydrp table{display:table;border-spacing:0}.mydrp table td{padding:0}.mydrp table,.mydrp td,.mydrp th{border:none}.mydrp .btnclearenabled:hover,.mydrp .btnpickerenabled:hover,.mydrp .headerclearbtnenabled:hover,.mydrp .headerokbtnenabled:hover{background-color:#E6E6E6}.mydrp .daycell:hover,.mydrp .monthcell:hover,.mydrp .yearcell:hover{background-color:#DDD}.mydrp .daycell,.mydrp .inputnoteditable,.mydrp .monthcell,.mydrp .monthlabel,.mydrp .yearcell,.mydrp .yearlabel{cursor:pointer}.mydrp .headerbtnenabled:hover,.mydrp .monthlabel:hover,.mydrp .yearchangebtnenabled:hover,.mydrp .yearlabel:hover{color:#777}@font-face{font-family:mydaterangepicker;src:url(data:application/octet-stream;base64,AAEAAAAPAIAAAwBwR1NVQiCMJXkAAAD8AAAAVE9TLzI+IEhNAAABUAAAAFZjbWFw6UKcfwAAAagAAAHEY3Z0IAbV/wQAAAvwAAAAIGZwZ22KkZBZAAAMEAAAC3BnYXNwAAAAEAAAC+gAAAAIZ2x5ZlJhR0YAAANsAAAEEGhlYWQNZzg7AAAHfAAAADZoaGVhBzwDWQAAB7QAAAAkaG10eBXB//8AAAfYAAAAIGxvY2EEIAKgAAAH+AAAABJtYXhwAXgMOgAACAwAAAAgbmFtZclNJHcAAAgsAAADOXBvc3RN1RmgAAALaAAAAH5wcmVw5UErvAAAF4AAAACGAAEAAAAKADAAPgACbGF0bgAOREZMVAAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAECuAGQAAUAAAJ6ArwAAACMAnoCvAAAAeAAMQECAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAQOgA6AYDUv9qAFoDUgCWAAAAAQAAAAAAAAAAAAUAAAADAAAALAAAAAQAAAFgAAEAAAAAAFoAAwABAAAALAADAAoAAAFgAAQALgAAAAQABAABAADoBv//AADoAP//AAAAAQAEAAAAAQACAAMABAAFAAYABwAAAQYAAAAAAAAA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TgjIDwjOBshICBGI0ewASsjYTghWbErARQrLbBCLLA1Ky6xKwEUKy2wQyywNishIyAgPLAEI0IjOLErARQrsARDLrArKy2wRCywABUgR7AAI0KyAAEBFRQTLrAxKi2wRSywABUgR7AAI0KyAAEBFRQTLrAxKi2wRiyxAAEUE7AyKi2wRyywNCotsEgssAAWRSMgLiBGiiNhOLErARQrLbBJLLAII0KwSCstsEossgAAQSstsEsssgABQSstsEwssgEAQSstsE0ssgEBQSstsE4ssgAAQistsE8ssgABQistsFAssgEAQistsFEssgEBQistsFIssgAAPistsFMssgABPistsFQssgEAPistsFUssgEBPistsFYssgAAQCstsFcssgABQCstsFgssgEAQCstsFkssgEBQCstsFossgAAQystsFsssgABQystsFwssgEAQystsF0ssgEBQystsF4ssgAAPystsF8ssgABPystsGAssgEAPystsGEssgEBPystsGIssDcrLrErARQrLbBjLLA3K7A7Ky2wZCywNyuwPCstsGUssAAWsDcrsD0rLbBmLLA4Ky6xKwEUKy2wZyywOCuwOystsGgssDgrsDwrLbBpLLA4K7A9Ky2waiywOSsusSsBFCstsGsssDkrsDsrLbBsLLA5K7A8Ky2wbSywOSuwPSstsG4ssDorLrErARQrLbBvLLA6K7A7Ky2wcCywOiuwPCstsHEssDorsD0rLbByLLMJBAIDRVghGyMhWUIrsAhlsAMkUHiwARUwLQBLuADIUlixAQGOWbABuQgACABjcLEABUKyAAEAKrEABUKzCgIBCCqxAAVCsw4AAQgqsQAGQroCwAABAAkqsQAHQroAQAABAAkqsQMARLEkAYhRWLBAiFixA2REsSYBiFFYugiAAAEEQIhjVFixAwBEWVlZWbMMAgEMKrgB/4WwBI2xAgBEAAA=) format(\'truetype\');font-weight:400;font-style:normal}.mydrp .mydrpicon{font-family:mydaterangepicker;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mydrp .icon-mydrpright:before{content:"\\e800"}.mydrp .icon-mydrpleft:before{content:"\\e801"}.mydrp .icon-mydrpup:before{content:"\\e802"}.mydrp .icon-mydrpdown:before{content:"\\e803"}.mydrp .icon-mydrpcalendar:before{content:"\\e804"}.mydrp .icon-mydrpok:before{content:"\\e805"}.mydrp .icon-mydrpremove:before{content:"\\e806"}'],template:'<div class="mydrp" [ngStyle]="{\'width\': opts.width, \'border\': opts.inline ? \'none\' : null}"><div class="selectiongroup" *ngIf="!opts.inline"><input type="text" class="selection" [attr.aria-label]="opts.ariaLabelInputField" (click)="opts.openSelectorOnInputClick&&!opts.editableDateRangeField&&openBtnClicked()" [attr.maxlength]="dateRangeFormat.length" [ngClass]="{\'invaliddaterange\': invalidDateRange&&opts.indicateInvalidDateRange, \'inputnoteditable\': opts.openSelectorOnInputClick&&!opts.editableDateRangeField, \'selectiondisabled\': opts.componentDisabled}" placeholder="{{placeholder}}" [ngStyle]="{\'height\': opts.height, \'font-size\': opts.selectionTxtFontSize}" [ngModel]="selectionDayTxt" (ngModelChange)="onUserDateRangeInput($event)" (keyup)="onCloseSelector($event)" (focus)="opts.editableDateRangeField&&onFocusInput($event)" (blur)="opts.editableDateRangeField&&onBlurInput($event)" [value]="selectionDayTxt" [disabled]="opts.componentDisabled" [readonly]="!opts.editableDateRangeField" autocomplete="off" spellcheck="false" autocorrect="off"> <span class="selbtngroup" [style.height]="opts.height"><button type="button" class="btnclear" [attr.aria-label]="opts.ariaLabelClearDateRange" *ngIf="selectionDayTxt.length>0&&opts.showClearDateRangeBtn" (click)="removeBtnClicked();$event.stopPropagation()" [ngClass]="{\'btnclearenabled\': !opts.componentDisabled, \'btncleardisabled\': opts.componentDisabled}" [disabled]="opts.componentDisabled"><span class="mydrpicon icon-mydrpremove"></span></button> <button type="button" class="btnpicker" [attr.aria-label]="opts.ariaLabelOpenCalendar" (click)="openBtnClicked()" [ngClass]="{\'btnpickerenabled\': !opts.componentDisabled, \'btnpickerdisabled\': opts.componentDisabled}" [disabled]="opts.componentDisabled"><span class="mydrpicon icon-mydrpcalendar"></span></button></span></div><div class="selector" #selectorEl *ngIf="showSelector||opts.inline" [ngStyle]="{\'width\': opts.selectorWidth, \'height\' : opts.selectorHeight}" [mydrpfocus]="opts.inline?\'0\':\'1\'" [ngClass]="{\'inline\': opts.inline, \'alignselectorright\': opts.alignSelectorRight, \'selectorarrow\': opts.showSelectorArrow&&!opts.inline, \'selectorarrowleft\': opts.showSelectorArrow&&!opts.alignSelectorRight&&!opts.inline, \'selectorarrowright\': opts.showSelectorArrow&&opts.alignSelectorRight&&!opts.inline}" (keyup)="onCloseSelector($event)" tabindex="0"><div class="titlearea" *ngIf="opts.showSelectDateText"><div class="titleareatxt">{{titleAreaText!==\'\'?titleAreaText:opts.selectBeginDateTxt}}</div></div><table class="header"><tr><td><div style="float:left"><div class="headerbtncell"><button type="button" class="headerbtn mydrpicon icon-mydrpleft" [attr.aria-label]="opts.ariaLabelPrevMonth" (click)="onPrevMonth()" [disabled]="prevMonthDisabled" [ngClass]="{\'headerbtnenabled\': !prevMonthDisabled, \'headerbtndisabled\': prevMonthDisabled}"></button></div><div class="headermonthtxt"><button class="headerlabelbtn" type="button" [ngClass]="{\'monthlabel\': opts.monthSelector}" (click)="opts.monthSelector&&onSelectMonthClicked($event)" tabindex="{{opts.monthSelector?\'0\':\'-1\'}}">{{visibleMonth.monthTxt}}</button></div><div class="headerbtncell"><button type="button" class="headerbtn mydrpicon icon-mydrpright" [attr.aria-label]="opts.ariaLabelNextMonth" (click)="onNextMonth()" [disabled]="nextMonthDisabled" [ngClass]="{\'headerbtnenabled\': !nextMonthDisabled, \'headerbtndisabled\': nextMonthDisabled}"></button></div></div></td><td><button type="button" class="headerclearbtn" *ngIf="opts.showClearBtn" [disabled]="beginDate.year===0&&endDate.year===0" [ngClass]="{\'clearbtndisabled\':beginDate.year===0&&endDate.year===0, \'headerclearbtnenabled\':beginDate.year!==0||endDate.year!==0}" (click)="clearDateRange()"><span class="mydrpicon icon-mydrpremove"></span></button> <button type="button" class="headerokbtn" *ngIf="opts.showApplyBtn" [disabled]="endDate.year===0" [ngClass]="{\'okbtndisabled\':endDate.year===0, \'headerokbtnenabled\':endDate.year!==0}" (click)="rangeSelected()"><span class="mydrpicon icon-mydrpok"></span></button></td><td><div style="float:right"><div class="headerbtncell"><button type="button" class="headerbtn mydrpicon icon-mydrpleft" [attr.aria-label]="opts.ariaLabelPrevYear" (click)="onPrevYear()" [disabled]="prevYearDisabled" [ngClass]="{\'headerbtnenabled\': !prevYearDisabled, \'headerbtndisabled\': prevYearDisabled}"></button></div><div class="headeryeartxt"><button class="headerlabelbtn" type="button" [ngClass]="{\'yearlabel\': opts.yearSelector}" (click)="opts.yearSelector&&onSelectYearClicked($event)" tabindex="{{opts.yearSelector?\'0\':\'-1\'}}">{{visibleMonth.year}}</button></div><div class="headerbtncell"><button type="button" class="headerbtn mydrpicon icon-mydrpright" [attr.aria-label]="opts.ariaLabelNextYear" (click)="onNextYear()" [disabled]="nextYearDisabled" [ngClass]="{\'headerbtnenabled\': !nextYearDisabled, \'headerbtndisabled\': nextYearDisabled}"></button></div></div></td></tr></table><table class="caltable" *ngIf="!selectMonth&&!selectYear" [ngStyle]="{\'height\': opts.showSelectDateText?\'calc(100% - 54px)\':\'calc(100% - 30px)\'}"><thead><tr><th class="weekdaytitle weekdaytitleweeknbr" *ngIf="opts.showWeekNumbers&&opts.firstDayOfWeek===\'mo\'">#</th><th class="weekdaytitle" scope="col" *ngFor="let d of weekDays">{{d}}</th></tr></thead><tbody><tr *ngFor="let w of dates"><td class="daycell daycellweeknbr" *ngIf="opts.showWeekNumbers&&opts.firstDayOfWeek===\'mo\'">{{w.weekNbr}}</td><td class="daycell" *ngFor="let d of w.week" [ngClass]="{\'currmonth\':d.cmo===currMonthId&&!d.disabled, \'range\': isInRange(d)||d.range, \'disabled\': d.disabled}" (click)="!d.disabled && onCellClicked(d);$event.stopPropagation()" (keydown)="onCellKeyDown($event, d)" (mouseenter)="onCellMouseEnter(d)" (mouseleave)="onCellMouseLeave()" tabindex="0"><div class="datevalue" [ngClass]="{\'prevmonth\':d.cmo===prevMonthId, \'selecteddaybegin\':beginDate.day===d.dateObj.day&&beginDate.month===d.dateObj.month&&beginDate.year===d.dateObj.year, \'selecteddayend\':endDate.day===d.dateObj.day&&endDate.month===d.dateObj.month&&endDate.year===d.dateObj.year, \'currmonth\':d.cmo===currMonthId, \'nextmonth\':d.cmo===nextMonthId, \'sunday\':d.dayNbr===0&&opts.sunHighlight}"><span [ngClass]="{\'markcurrday\':d.currDay&&opts.markCurrentDay, \'sundayDim\': opts.sunHighlight && d.dayNbr === 0 && (d.cmo===prevMonthId || d.cmo===nextMonthId || d.disabled)}">{{d.dateObj.day}}</span></div></td></tr></tbody></table><table class="monthtable" *ngIf="selectMonth" [ngStyle]="{\'height\': opts.showSelectDateText?\'calc(100% - 54px)\':\'calc(100% - 30px)\'}"><tbody><tr *ngFor="let mr of months"><td class="monthcell tablesinglemonth" [ngClass]="{\'selectedmonth\': m.selected, \'disabled\': m.disabled}" *ngFor="let m of mr" (click)="!m.disabled&&onMonthCellClicked(m);$event.stopPropagation()" (keydown)="onMonthCellKeyDown($event, m)" tabindex="0"><div class="monthvalue" [ngClass]="{\'markcurrmonth\':m.currMonth&&opts.markCurrentMonth}">{{m.name}}</div></td></tr></tbody></table><table class="yeartable" *ngIf="selectYear" [ngStyle]="{\'height\': opts.showSelectDateText?\'calc(100% - 54px)\':\'calc(100% - 30px)\'}"><tbody><tr><td colspan="5" class="yearchangebtncell" (click)="$event.stopPropagation()"><button type="button" class="yearchangebtn mydrpicon icon-mydrpup" (click)="onPrevYears($event, years[0][0].year)" [disabled]="prevYearsDisabled" [ngClass]="{\'yearchangebtnenabled\': !prevYearsDisabled, \'yearchangebtndisabled\': prevYearsDisabled}"></button></td></tr><tr *ngFor="let yr of years"><td class="yearcell tablesingleyear" [ngClass]="{\'selectedyear\': y.selected, \'disabled\': y.disabled}" *ngFor="let y of yr" (click)="!y.disabled&&onYearCellClicked(y);$event.stopPropagation()" (keydown)="onYearCellKeyDown($event, y)" tabindex="0"><div class="yearvalue" [ngClass]="{\'markcurryear\':y.currYear&&opts.markCurrentYear}">{{y.year}}</div></td></tr><tr><td colspan="5" class="yearchangebtncell" (click)="$event.stopPropagation()"><button type="button" class="yearchangebtn mydrpicon icon-mydrpdown" (click)="onNextYears($event, years[0][0].year)" [disabled]="nextYearsDisabled" [ngClass]="{\'yearchangebtnenabled\': !nextYearsDisabled, \'yearchangebtndisabled\': nextYearsDisabled}"></button></td></tr></tbody></table></div></div>',providers:[r,n],encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=[{type:t.ElementRef},{type:t.Renderer},{type:t.ChangeDetectorRef},{type:r}],e.propDecorators={options:[{type:t.Input}],defaultMonth:[{type:t.Input}],selDateRange:[{type:t.Input}],placeholder:[{type:t.Input}],dateRangeChanged:[{type:t.Output}],inputFieldChanged:[{type:t.Output}],calendarViewChanged:[{type:t.Output}],inputFocusBlur:[{type:t.Output}],dateSelected:[{type:t.Output}],selectorEl:[{type:t.ViewChild,args:["selectorEl"]}]},e}(),p=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[s.CommonModule,a.FormsModule],declarations:[h,i],exports:[h,i]}]}],e.ctorParameters=[],e}();e.DateRangeUtilService=r,e.FocusDirective=i,e.MYDRP_VALUE_ACCESSOR=n,e.MyDateRangePicker=h,e.MyDateRangePickerModule=p,Object.defineProperty(e,"__esModule",{value:!0})});