{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../src/app/components/calendar/calendar.ts"],"names":["Object","create","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","__read","n","r","e","ar","push","error","__spread","arguments","concat","CALENDAR_VALUE_ACCESSOR","provide","NG_VALUE_ACCESSOR","useExisting","forwardRef","Calendar","multi","el","renderer","cd","zone","config","this","dateFormat","multipleSeparator","rangeSeparator","inline","showOtherMonths","icon","shortYearCutoff","hourFormat","stepHour","stepMinute","stepSecond","showSeconds","showOnFocus","showWeek","dataType","selectionMode","todayButtonStyleClass","clearButtonStyleClass","autoZIndex","baseZIndex","keepInvalid","hideOnDateTimeSelect","numberOfMonths","view","timeSeparator","focusTrap","firstDayOfWeek","showTransitionOptions","hideTransitionOptions","onFocus","EventEmitter","onBlur","onClose","onSelect","onInput","onTodayClick","onClearClick","onMonthChange","onYearChange","onClickOutside","onShow","onModelChange","onModelTouched","inputFieldValue","navigationState","convertTo24Hour","hours","pm","defineProperty","prototype","content","_this","contentViewChild","isMonthNavigate","Promise","resolve","then","updateFocus","initFocusableCell","_defaultDate","defaultDate","initialized","date","Date","currentMonth","getMonth","currentYear","getFullYear","initTime","createMonths","_minDate","undefined","_maxDate","_disabledDates","disabledDates","_disabledDays","disabledDays","_yearRange","yearRange","years","split","yearStart","parseInt","yearEnd","populateYearOptions","_showTime","showTime","currentHour","updateInputfield","_locale","newLocale","console","warn","ngOnInit","createWeekDays","ticksTo1970","Math","floor","createMonthPickerValues","ngAfterContentInit","templates","forEach","item","getType","dateTemplate","template","disabledDateTemplate","headerTemplate","footerTemplate","getTranslation","option","start","end","yearOptions","weekDays","dayIndex","dayLabels","TranslationKeys","DAY_NAMES_MIN","monthPickerValues","monthLabels","MONTH_NAMES_SHORT","month","year","months","y","createMonth","getWeekNumber","checkDate","getTime","setDate","getDate","getDay","time","setMonth","round","dates","firstDay","getFirstDayOfMonthIndex","daysLength","getDaysCountInMonth","prevMonthDaysLength","getDaysCountInPrevMonth","dayNo","today","weekNumbers","monthRows","ceil","week","j","prev","getPreviousMonthAndYear","day","otherMonth","isToday","selectable","isSelectable","remainingDaysLength","getNextMonthAndYear","getHours","currentMinute","getMinutes","currentSecond","getSeconds","setCurrentHourPM","timeOnly","navBackward","event","stopPropagation","disabled","preventDefault","decrementYear","setTimeout","emit","navForward","incrementYear","yearNavigator","difference","onDateSelect","dateMeta","isMultipleSelection","isSelected","filter","isDateEquals","updateModel","shouldSelectDate","selectDate","isSingleSelection","hideOverlay","mask","disableModality","markForCheck","maxDateCount","onMonthSelect","index","DomHandler","hasClass","target","formattedValue","formatDateTime","isRangeSelection","startDate","endDate","updateFilledState","inputfieldViewChild","nativeElement","formatTime","formatDate","getDateFormat","setHours","setMinutes","setSeconds","minDate","maxDate","stringArrValue","map","setFullYear","getSundayIndex","daylightSavingAdjust","selected","_b","_c","isDateBetween","isMonthSelected","Array","isArray","validMin","validMax","validDate","validDay","selectOtherMonths","isDateDisabled","isDayDisabled","disabledDate","weekdayNumber","indexOf","onInputFocus","focus","showOverlay","onInputClick","overlay","style","zIndex","String","zindex","overlayVisible","onInputBlur","onButtonClick","inputfield","onPrevButtonClick","backward","button","onNextButtonClick","onContainerButtonKeydown","which","trapFocus","onInputKeydown","isKeydown","keyCode","getFocusableElements","tabIndex","onDateCellKeydown","groupIndex","cellContent","currentTarget","cell","parentElement","cellIndex","nextRow","nextElementSibling","focusCell","children","prevRow","previousElementSibling","prevCell","navigateToMonth","nextCell","onMonthCellKeydown","cells","prevMonthContainer","find","nextMonthContainer","findSingle","selectedCell","todayCell","focusableElements","ownerDocument","activeElement","focusedIndex","shiftKey","onMonthDropdownChange","onYearDropdownChange","validateTime","hour","minute","second","convertedHour","valueDateString","toDateString","incrementHour","prevHour","newHour","newPM","onTimePickerElementMouseDown","type","direction","repeat","onTimePickerElementMouseUp","clearTimePickerTimer","updateTime","onTimePickerElementMouseOut","timePickerTimer","interval","decrementHour","incrementMinute","decrementMinute","incrementSecond","decrementSecond","clearTimeout","newMinute","newSecond","slice","toggleAMPM","onUserInput","val","parseValueFromString","isValidSelection","updateUI","err","filled","isValid","every","v","text","trim","parseDateTime","tokens","tokens_1","tokens_1_1","token","parts","populateTime","ampm","pop","timeString","parseDate","join","parseTime","touchUI","toggle","onOverlayAnimationStart","toState","element","appendOverlay","alignOverlay","onOverlayHide","onOverlayAnimationDone","bindDocumentClickListener","bindDocumentResizeListener","bindScrollListener","appendTo","document","body","appendChild","restoreOverlayAppend","enableModality","absolutePosition","relativePosition","createElement","addMultipleClasses","maskClickListener","listen","addClass","removeChild","bodyChildren","hasBlockerMasks","bodyChild","removeClass","unbindMaskClickListener","writeValue","registerOnChange","fn","registerOnTouched","setDisabledState","format","iFormat","lookAhead","match","matches","charAt","formatNumber","len","num","formatName","shortNames","longNames","output","literal","DAY_NAMES_SHORT","DAY_NAMES","MONTH_NAMES","minutes","seconds","validTokenLength","h","isNaN","toString","dim","extra","iValue","doy","getNumber","isDoubled","size","digits","RegExp","substring","getName","arr","names","sort","a","b","name","substr","toLowerCase","checkLiteral","test","onTodayButtonClick","onClearButtonClick","documentClickListener","runOutsideAngular","documentTarget","isOutsideClicked","run","unbindDocumentClickListener","documentResizeListener","onWindowResize","bind","window","addEventListener","unbindDocumentResizeListener","removeEventListener","scrollHandler","ConnectedOverlayScrollHandler","containerViewChild","unbindScrollListener","isSameNode","isNavIconClicked","contains","isAndroid","ngOnDestroy","destroy","Component","args","selector","animations","trigger","state","transform","opacity","transition","animate","host","[class.p-inputwrapper-filled]","[class.p-inputwrapper-focus]","providers","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","ElementRef","Renderer2","ChangeDetectorRef","NgZone","PrimeNGConfig","Input","Output","ContentChildren","PrimeTemplate","ViewChild","static","NgModule","imports","CommonModule","ButtonModule","SharedModule","RippleModule","exports","declarations"],"mappings":";;;;;;;;;;;;;;oFAyG6BA,OAAOC,gBAYpBC,EAASC,GACrB,IAAIC,EAAsB,mBAAXC,QAAyBA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,EAAAA,wBAEAA,EAAAA,yBAEAA,EAAAA,wBAEAA,EAAAA,6BAEAA,EAAAA,6BAEAA,EAAAA,8BAEAA,EAAAA,6BAEAA,EAAAA,+BAEAA,EAAAA,uBAEAA,EAAAA,0BAEAC,EAAAA,gBAAe1B,KAAA,CAAC2B,EAAAA,iCAEhBH,EAAAA,kCAEAI,EAAAA,UAAS5B,KAAA,CAAC,YAAa,CAAE6B,QAAQ,iCAEjCD,EAAAA,UAAS5B,KAAA,CAAC,aAAc,CAAE6B,QAAQ,qBAElCD,EAAAA,UAAS5B,KAAA,CAAC,iBAAkB,CAAE6B,QAAQ,yBA4GtCL,EAAAA,uBAmBAA,EAAAA,uBAYAA,EAAAA,6BAYAA,EAAAA,4BAYAA,EAAAA,yBAYAA,EAAAA,wBAgBAA,EAAAA,sBAiBAA,EAAAA,eAggEL,iCALCM,EAAAA,SAAQ9B,KAAA,CAAC,CACN+B,QAAS,CAACC,EAAAA,aAAaC,EAAAA,aAAaC,EAAAA,aAAaC,EAAAA,cACjDC,QAAS,CAAClf,EAAS+e,EAAAA,aAAaC,EAAAA,cAChCG,aAAc,CAACnf","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {NgModule,Component,ElementRef,OnDestroy,OnInit,Input,Output,EventEmitter,forwardRef,Renderer2,\n ViewChild,ChangeDetectorRef,TemplateRef,ContentChildren,QueryList,NgZone,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {trigger,state,style,transition,animate,AnimationEvent} from '@angular/animations';\nimport {CommonModule} from '@angular/common';\nimport {ButtonModule} from 'primeng/button';\nimport {RippleModule} from 'primeng/ripple';\nimport {DomHandler, ConnectedOverlayScrollHandler} from 'primeng/dom';\nimport {SharedModule,PrimeTemplate,PrimeNGConfig,TranslationKeys} from 'primeng/api';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\n\nexport const CALENDAR_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Calendar),\n multi: true\n};\n\nexport interface LocaleSettings {\n firstDayOfWeek?: number;\n dayNames?: string[];\n dayNamesShort?: string[];\n dayNamesMin?: string[];\n monthNames?: string[];\n monthNamesShort?: string[];\n today?: string;\n clear?: string;\n dateFormat?: string;\n weekHeader?: string;\n}\n\n@Component({\n selector: 'p-calendar',\n template: `\n \n \n \n \n
1, 'p-datepicker-monthpicker': (view === 'month'), 'p-datepicker-touch-ui': touchUI}\"\n [@overlayAnimation]=\"touchUI ? {value: 'visibleTouchUI', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}:\n {value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}\"\n [@.disabled]=\"inline === true\" (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\" (@overlayAnimation.done)=\"onOverlayAnimationDone($event)\" *ngIf=\"inline || overlayVisible\">\n \n \n \n
\n
\n
\n \n
\n {{getTranslation('monthNames')[month.month]}}\n \n \n {{view === 'month' ? currentYear : month.year}}\n
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {{getTranslation('weekHeader')}}\n \n {{weekDay}}\n
\n \n {{month.weekNumbers[j]}}\n \n \n \n \n {{date.day}}\n \n \n \n
\n
\n
\n
\n
\n \n {{m}}\n \n
\n
\n
\n
\n \n 0{{currentHour}}\n \n
\n
\n {{timeSeparator}}\n
\n
\n \n 0{{currentMinute}}\n \n
\n
\n {{timeSeparator}}\n
\n
\n \n 0{{currentSecond}}\n \n
\n
\n \n {{pm ? 'PM' : 'AM'}}\n \n
\n
\n
\n \n \n
\n \n \n
\n
\n `,\n animations: [\n trigger('overlayAnimation', [\n state('visibleTouchUI', style({\n transform: 'translate(-50%,-50%)',\n opacity: 1\n })),\n transition('void => visible', [\n style({opacity: 0, transform: 'scaleY(0.8)'}),\n animate('{{showTransitionParams}}', style({ opacity: 1, transform: '*' }))\n ]),\n transition('visible => void', [\n animate('{{hideTransitionParams}}', style({ opacity: 0 }))\n ]),\n transition('void => visibleTouchUI', [\n style({opacity: 0, transform: 'translate3d(-50%, -40%, 0) scale(0.9)'}),\n animate('{{showTransitionParams}}')\n ]),\n transition('visibleTouchUI => void', [\n animate(('{{hideTransitionParams}}'),\n style({\n opacity: 0,\n transform: 'translate3d(-50%, -40%, 0) scale(0.9)'\n }))\n ])\n ])\n ],\n host: {\n '[class.p-inputwrapper-filled]': 'filled',\n '[class.p-inputwrapper-focus]': 'focus'\n },\n providers: [CALENDAR_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./calendar.css']\n})\nexport class Calendar implements OnInit,OnDestroy,ControlValueAccessor {\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() inputStyle: any;\n\n @Input() inputId: string;\n\n @Input() name: string;\n\n @Input() inputStyleClass: string;\n\n @Input() placeholder: string;\n\n @Input() ariaLabelledBy: string;\n\n @Input() disabled: any;\n\n @Input() dateFormat: string = 'mm/dd/yy';\n\n @Input() multipleSeparator: string = ',';\n\n @Input() rangeSeparator: string = '-';\n\n @Input() inline: boolean = false;\n\n @Input() showOtherMonths: boolean = true;\n\n @Input() selectOtherMonths: boolean;\n\n @Input() showIcon: boolean;\n\n @Input() icon: string = 'pi pi-calendar';\n\n @Input() appendTo: any;\n\n @Input() readonlyInput: boolean;\n\n @Input() shortYearCutoff: any = '+10';\n\n @Input() monthNavigator: boolean;\n\n @Input() yearNavigator: boolean;\n\n @Input() hourFormat: string = '24';\n\n @Input() timeOnly: boolean;\n\n @Input() stepHour: number = 1;\n\n @Input() stepMinute: number = 1;\n\n @Input() stepSecond: number = 1;\n\n @Input() showSeconds: boolean = false;\n\n @Input() required: boolean;\n\n @Input() showOnFocus: boolean = true;\n\n @Input() showWeek: boolean = false;\n\n @Input() dataType: string = 'date';\n\n @Input() selectionMode: string = 'single';\n\n @Input() maxDateCount: number;\n\n @Input() showButtonBar: boolean;\n\n @Input() todayButtonStyleClass: string = 'p-button-text';\n\n @Input() clearButtonStyleClass: string = 'p-button-text';\n\n @Input() autoZIndex: boolean = true;\n\n @Input() baseZIndex: number = 0;\n\n @Input() panelStyleClass: string;\n\n @Input() panelStyle: any;\n\n @Input() keepInvalid: boolean = false;\n\n @Input() hideOnDateTimeSelect: boolean = true;\n\n @Input() numberOfMonths: number = 1;\n\n @Input() view: string = 'date';\n\n @Input() touchUI: boolean;\n\n @Input() timeSeparator: string = \":\";\n\n @Input() focusTrap: boolean = true;\n\n @Input() firstDayOfWeek: number = 0;\n\n @Input() showTransitionOptions: string = '.12s cubic-bezier(0, 0, 0.2, 1)';\n\n @Input() hideTransitionOptions: string = '.1s linear';\n\n @Output() onFocus: EventEmitter = new EventEmitter();\n\n @Output() onBlur: EventEmitter = new EventEmitter();\n\n @Output() onClose: EventEmitter = new EventEmitter();\n\n @Output() onSelect: EventEmitter = new EventEmitter();\n\n @Output() onInput: EventEmitter = new EventEmitter();\n\n @Output() onTodayClick: EventEmitter = new EventEmitter();\n\n @Output() onClearClick: EventEmitter = new EventEmitter();\n\n @Output() onMonthChange: EventEmitter = new EventEmitter();\n\n @Output() onYearChange: EventEmitter = new EventEmitter();\n\n @Output() onClickOutside: EventEmitter = new EventEmitter();\n\n @Output() onShow: EventEmitter = new EventEmitter();\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n @Input() tabindex: number;\n\n @ViewChild('container', { static: false }) containerViewChild: ElementRef;\n\n @ViewChild('inputfield', { static: false }) inputfieldViewChild: ElementRef;\n\n @ViewChild('contentWrapper', { static: false }) set content (content: ElementRef) {\n this.contentViewChild = content;\n\n if (this.contentViewChild) {\n if (this.isMonthNavigate) {\n Promise.resolve(null).then(() => this.updateFocus());\n this.isMonthNavigate = false;\n }\n else {\n this.initFocusableCell();\n }\n }\n };\n\n contentViewChild: ElementRef;\n\n value: any;\n\n dates: any[];\n\n months: any[];\n\n monthPickerValues: any[];\n\n weekDays: string[];\n\n currentMonth: number;\n\n currentYear: number;\n\n currentHour: number;\n\n currentMinute: number;\n\n currentSecond: number;\n\n pm: boolean;\n\n mask: HTMLDivElement;\n\n maskClickListener: Function;\n\n overlay: HTMLDivElement;\n\n overlayVisible: boolean;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n calendarElement: any;\n\n timePickerTimer:any;\n\n documentClickListener: any;\n\n ticksTo1970: number;\n\n yearOptions: number[];\n\n focus: boolean;\n\n isKeydown: boolean;\n\n filled: boolean;\n\n inputFieldValue: string = null;\n\n _minDate: Date;\n\n _maxDate: Date;\n\n _showTime: boolean;\n\n _yearRange: string;\n\n preventDocumentListener: boolean;\n\n dateTemplate: TemplateRef;\n\n headerTemplate: TemplateRef;\n\n footerTemplate: TemplateRef;\n\n disabledDateTemplate: TemplateRef;\n\n _disabledDates: Array;\n\n _disabledDays: Array;\n\n selectElement: any;\n\n todayElement: any;\n\n focusElement: any;\n\n scrollHandler: any;\n\n documentResizeListener: any;\n\n navigationState: any = null;\n\n isMonthNavigate: boolean;\n\n initialized: boolean;\n\n _locale: LocaleSettings;\n\n @Input() get defaultDate(): Date {\n return this._defaultDate;\n };\n\n set defaultDate(defaultDate: Date) {\n this._defaultDate = defaultDate;\n \n if (this.initialized) {\n const date = defaultDate||new Date();\n this.currentMonth = date.getMonth();\n this.currentYear = date.getFullYear();\n this.initTime(date);\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n _defaultDate: Date;\n\n\n @Input() get minDate(): Date {\n return this._minDate;\n }\n\n set minDate(date: Date) {\n this._minDate = date;\n\n if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n @Input() get maxDate(): Date {\n return this._maxDate;\n }\n\n set maxDate(date: Date) {\n this._maxDate = date;\n\n if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n @Input() get disabledDates(): Date[] {\n return this._disabledDates;\n }\n\n set disabledDates(disabledDates: Date[]) {\n this._disabledDates = disabledDates;\n if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {\n\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n @Input() get disabledDays(): number[] {\n return this._disabledDays;\n }\n\n set disabledDays(disabledDays: number[]) {\n this._disabledDays = disabledDays;\n\n if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n @Input() get yearRange(): string {\n return this._yearRange;\n }\n\n set yearRange(yearRange: string) {\n this._yearRange = yearRange;\n\n if (yearRange) {\n const years = yearRange.split(':');\n const yearStart = parseInt(years[0]);\n const yearEnd = parseInt(years[1]);\n\n this.populateYearOptions(yearStart, yearEnd);\n }\n }\n\n @Input() get showTime(): boolean {\n return this._showTime;\n }\n\n set showTime(showTime: boolean) {\n this._showTime = showTime;\n\n if (this.currentHour === undefined) {\n this.initTime(this.value||new Date());\n }\n this.updateInputfield();\n }\n\n get locale() {\n return this._locale;\n }\n\n @Input()\n set locale(newLocale: LocaleSettings) {\n console.warn(\"Locale property has no effect, use new i18n API instead.\");\n }\n\n constructor(public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, private zone: NgZone, private config: PrimeNGConfig) {}\n\n ngOnInit() {\n const date = this.defaultDate||new Date();\n this.currentMonth = date.getMonth();\n this.currentYear = date.getFullYear();\n\n if (this.view === 'date') {\n this.createWeekDays();\n this.initTime(date);\n this.createMonths(this.currentMonth, this.currentYear);\n this.ticksTo1970 = (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000);\n }\n else if (this.view === 'month') {\n this.createMonthPickerValues();\n }\n\n this.initialized = true;\n }\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch (item.getType()) {\n case 'date':\n this.dateTemplate = item.template;\n break;\n\n case 'disabledDate':\n this.disabledDateTemplate = item.template;\n break;\n\n case 'header':\n this.headerTemplate = item.template;\n break;\n\n case 'footer':\n this.footerTemplate = item.template;\n break;\n\n default:\n this.dateTemplate = item.template;\n break;\n }\n });\n }\n\n getTranslation(option: string) {\n return this.config.getTranslation(option);\n }\n\n populateYearOptions(start, end) {\n this.yearOptions = [];\n\n for (let i = start; i <= end; i++) {\n this.yearOptions.push(i);\n }\n }\n\n createWeekDays() {\n this.weekDays = [];\n let dayIndex = this.firstDayOfWeek;\n let dayLabels = this.getTranslation(TranslationKeys.DAY_NAMES_MIN);\n for (let i = 0; i < 7; i++) {\n this.weekDays.push(dayLabels[dayIndex]);\n dayIndex = (dayIndex == 6) ? 0 : ++dayIndex;\n }\n }\n\n createMonthPickerValues() {\n this.monthPickerValues = [];\n let monthLabels = this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT);\n for (let i = 0; i <= 11; i++) {\n this.monthPickerValues.push(monthLabels[i]);\n }\n }\n\n createMonths(month: number, year: number) {\n this.months = this.months = [];\n for (let i = 0 ; i < this.numberOfMonths; i++) {\n let m = month + i;\n let y = year;\n if (m > 11) {\n m = m % 11 - 1;\n y = year + 1;\n }\n\n this.months.push(this.createMonth(m, y));\n }\n }\n\n getWeekNumber(date: Date) {\n let checkDate = new Date(date.getTime());\n\t\tcheckDate.setDate(checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ));\n\t\tlet time = checkDate.getTime();\n\t\tcheckDate.setMonth( 0 );\n\t\tcheckDate.setDate( 1 );\n\t\treturn Math.floor( Math.round((time - checkDate.getTime()) / 86400000 ) / 7 ) + 1;\n }\n\n createMonth(month: number, year: number) {\n let dates = [];\n let firstDay = this.getFirstDayOfMonthIndex(month, year);\n let daysLength = this.getDaysCountInMonth(month, year);\n let prevMonthDaysLength = this.getDaysCountInPrevMonth(month, year);\n let dayNo = 1;\n let today = new Date();\n let weekNumbers = [];\n let monthRows = Math.ceil((daysLength + firstDay) / 7);\n\n for (let i = 0; i < monthRows; i++) {\n let week = [];\n\n if (i == 0) {\n for (let j = (prevMonthDaysLength - firstDay + 1); j <= prevMonthDaysLength; j++) {\n let prev = this.getPreviousMonthAndYear(month, year);\n week.push({day: j, month: prev.month, year: prev.year, otherMonth: true,\n today: this.isToday(today, j, prev.month, prev.year), selectable: this.isSelectable(j, prev.month, prev.year, true)});\n }\n\n let remainingDaysLength = 7 - week.length;\n for (let j = 0; j < remainingDaysLength; j++) {\n week.push({day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),\n selectable: this.isSelectable(dayNo, month, year, false)});\n dayNo++;\n }\n }\n else {\n for (let j = 0; j < 7; j++) {\n if (dayNo > daysLength) {\n let next = this.getNextMonthAndYear(month, year);\n week.push({day: dayNo - daysLength, month: next.month, year: next.year, otherMonth: true,\n today: this.isToday(today, dayNo - daysLength, next.month, next.year),\n selectable: this.isSelectable((dayNo - daysLength), next.month, next.year, true)});\n }\n else {\n week.push({day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),\n selectable: this.isSelectable(dayNo, month, year, false)});\n }\n\n dayNo++;\n }\n }\n\n if (this.showWeek) {\n weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));\n }\n\n dates.push(week);\n }\n\n return {\n month: month,\n year: year,\n dates: dates,\n weekNumbers: weekNumbers\n };\n }\n\n initTime(date: Date) {\n this.pm = date.getHours() > 11;\n\n if (this.showTime) {\n this.currentMinute = date.getMinutes();\n this.currentSecond = date.getSeconds();\n this.setCurrentHourPM(date.getHours());\n }\n else if (this.timeOnly) {\n this.currentMinute = 0;\n this.currentHour = 0;\n this.currentSecond = 0;\n }\n }\n\n navBackward(event) {\n event.stopPropagation();\n\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.isMonthNavigate = true;\n\n if (this.view === 'month') {\n this.decrementYear();\n setTimeout(()=> {\n this.updateFocus();\n },1);\n }\n else {\n if (this.currentMonth === 0) {\n this.currentMonth = 11;\n this.decrementYear();\n }\n else {\n this.currentMonth--;\n }\n\n this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n navForward(event) {\n event.stopPropagation();\n\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.isMonthNavigate = true;\n\n if (this.view === 'month') {\n this.incrementYear();\n setTimeout(()=> {\n this.updateFocus();\n },1);\n }\n else {\n if (this.currentMonth === 11) {\n this.currentMonth = 0;\n this.incrementYear();\n }\n else {\n this.currentMonth++;\n }\n\n this.onMonthChange.emit({month: this.currentMonth + 1, year: this.currentYear});\n this.createMonths(this.currentMonth, this.currentYear);\n }\n }\n\n decrementYear() {\n this.currentYear--;\n\n if (this.yearNavigator && this.currentYear < this.yearOptions[0]) {\n let difference = this.yearOptions[this.yearOptions.length - 1] - this.yearOptions[0];\n this.populateYearOptions(this.yearOptions[0] - difference, this.yearOptions[this.yearOptions.length - 1] - difference);\n }\n }\n\n incrementYear() {\n this.currentYear++;\n\n if (this.yearNavigator && this.currentYear > this.yearOptions[this.yearOptions.length - 1]) {\n let difference = this.yearOptions[this.yearOptions.length - 1] - this.yearOptions[0];\n this.populateYearOptions(this.yearOptions[0] + difference, this.yearOptions[this.yearOptions.length - 1] + difference);\n }\n }\n\n onDateSelect(event, dateMeta) {\n if (this.disabled || !dateMeta.selectable) {\n event.preventDefault();\n return;\n }\n\n if (this.isMultipleSelection() && this.isSelected(dateMeta)) {\n this.value = this.value.filter((date, i) => {\n return !this.isDateEquals(date, dateMeta);\n });\n if (this.value.length === 0) {\n this.value = null;\n }\n this.updateModel(this.value);\n }\n else {\n if (this.shouldSelectDate(dateMeta)) {\n this.selectDate(dateMeta);\n }\n }\n\n if (this.isSingleSelection() && this.hideOnDateTimeSelect) {\n setTimeout(() => {\n event.preventDefault();\n this.hideOverlay();\n\n if (this.mask) {\n this.disableModality();\n }\n\n this.cd.markForCheck();\n }, 150);\n }\n\n this.updateInputfield();\n event.preventDefault();\n }\n\n shouldSelectDate(dateMeta) {\n if (this.isMultipleSelection())\n return this.maxDateCount != null ? this.maxDateCount > (this.value ? this.value.length : 0) : true;\n else\n return true;\n }\n\n onMonthSelect(event, index) {\n if (!DomHandler.hasClass(event.target, 'p-disabled')) {\n this.onDateSelect(event, {year: this.currentYear, month: index, day: 1, selectable: true});\n }\n }\n\n updateInputfield() {\n let formattedValue = '';\n\n if (this.value) {\n if (this.isSingleSelection()) {\n formattedValue = this.formatDateTime(this.value);\n }\n else if (this.isMultipleSelection()) {\n for (let i = 0; i < this.value.length; i++) {\n let dateAsString = this.formatDateTime(this.value[i]);\n formattedValue += dateAsString;\n if (i !== (this.value.length - 1)) {\n formattedValue += this.multipleSeparator+' ';\n }\n }\n }\n else if (this.isRangeSelection()) {\n if (this.value && this.value.length) {\n let startDate = this.value[0];\n let endDate = this.value[1];\n\n formattedValue = this.formatDateTime(startDate);\n if (endDate) {\n formattedValue += ' '+this.rangeSeparator +' ' + this.formatDateTime(endDate);\n }\n }\n }\n }\n\n this.inputFieldValue = formattedValue;\n this.updateFilledState();\n if (this.inputfieldViewChild && this.inputfieldViewChild.nativeElement) {\n this.inputfieldViewChild.nativeElement.value = this.inputFieldValue;\n }\n }\n\n formatDateTime(date) {\n let formattedValue = null;\n if (date) {\n if (this.timeOnly) {\n formattedValue = this.formatTime(date);\n }\n else {\n formattedValue = this.formatDate(date, this.getDateFormat());\n if (this.showTime) {\n formattedValue += ' ' + this.formatTime(date);\n }\n }\n }\n\n return formattedValue;\n }\n\n setCurrentHourPM(hours: number) {\n if (this.hourFormat == '12') {\n this.pm = hours > 11;\n if (hours >= 12) {\n this.currentHour = (hours == 12) ? 12 : hours - 12;\n }\n else {\n this.currentHour = (hours == 0) ? 12 : hours;\n }\n }\n else {\n this.currentHour = hours;\n }\n }\n\n selectDate(dateMeta) {\n let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);\n\n if (this.showTime) {\n if (this.hourFormat == '12') {\n if (this.currentHour === 12)\n date.setHours(this.pm ? 12 : 0);\n else\n date.setHours(this.pm ? this.currentHour + 12 : this.currentHour);\n }\n else {\n date.setHours(this.currentHour);\n }\n\n date.setMinutes(this.currentMinute);\n date.setSeconds(this.currentSecond);\n }\n\n if (this.minDate && this.minDate > date) {\n date = this.minDate;\n this.setCurrentHourPM(date.getHours());\n this.currentMinute = date.getMinutes();\n this.currentSecond = date.getSeconds();\n }\n\n if (this.maxDate && this.maxDate < date) {\n date = this.maxDate;\n this.setCurrentHourPM(date.getHours());\n this.currentMinute = date.getMinutes();\n this.currentSecond = date.getSeconds();\n }\n\n if (this.isSingleSelection()) {\n this.updateModel(date);\n }\n else if (this.isMultipleSelection()) {\n this.updateModel(this.value ? [...this.value, date] : [date]);\n }\n else if (this.isRangeSelection()) {\n if (this.value && this.value.length) {\n let startDate = this.value[0];\n let endDate = this.value[1];\n\n if (!endDate && date.getTime() >= startDate.getTime()) {\n endDate = date;\n }\n else {\n startDate = date;\n endDate = null;\n }\n\n this.updateModel([startDate, endDate]);\n }\n else {\n this.updateModel([date, null]);\n }\n }\n\n this.onSelect.emit(date);\n }\n\n updateModel(value) {\n this.value = value;\n\n if (this.dataType == 'date') {\n this.onModelChange(this.value);\n }\n else if (this.dataType == 'string') {\n if (this.isSingleSelection()) {\n this.onModelChange(this.formatDateTime(this.value));\n }\n else {\n let stringArrValue = null;\n if (this.value) {\n stringArrValue = this.value.map(date => this.formatDateTime(date));\n }\n this.onModelChange(stringArrValue);\n }\n }\n }\n\n getFirstDayOfMonthIndex(month: number, year: number) {\n let day = new Date();\n day.setDate(1);\n day.setMonth(month);\n day.setFullYear(year);\n\n let dayIndex = day.getDay() + this.getSundayIndex();\n return dayIndex >= 7 ? dayIndex - 7 : dayIndex;\n }\n\n getDaysCountInMonth(month: number, year: number) {\n return 32 - this.daylightSavingAdjust(new Date(year, month, 32)).getDate();\n }\n\n getDaysCountInPrevMonth(month: number, year: number) {\n let prev = this.getPreviousMonthAndYear(month, year);\n return this.getDaysCountInMonth(prev.month, prev.year);\n }\n\n getPreviousMonthAndYear(month: number, year: number) {\n let m, y;\n\n if (month === 0) {\n m = 11;\n y = year - 1;\n }\n else {\n m = month - 1;\n y = year;\n }\n\n return {'month':m,'year':y};\n }\n\n getNextMonthAndYear(month: number, year: number) {\n let m, y;\n\n if (month === 11) {\n m = 0;\n y = year + 1;\n }\n else {\n m = month + 1;\n y = year;\n }\n\n return {'month':m,'year':y};\n }\n\n getSundayIndex() {\n return this.firstDayOfWeek > 0 ? 7 - this.firstDayOfWeek : 0;\n }\n\n isSelected(dateMeta): boolean {\n if (this.value) {\n if (this.isSingleSelection()) {\n return this.isDateEquals(this.value, dateMeta);\n }\n else if (this.isMultipleSelection()) {\n let selected = false;\n for (let date of this.value) {\n selected = this.isDateEquals(date, dateMeta);\n if (selected) {\n break;\n }\n }\n\n return selected;\n }\n else if (this.isRangeSelection()) {\n if (this.value[1])\n return this.isDateEquals(this.value[0], dateMeta) || this.isDateEquals(this.value[1], dateMeta) || this.isDateBetween(this.value[0], this.value[1], dateMeta);\n else\n return this.isDateEquals(this.value[0], dateMeta)\n }\n }\n else {\n return false;\n }\n }\n\n isMonthSelected(month: number): boolean {\n let day = this.value ? (Array.isArray(this.value) ? this.value[0].getDate() : this.value.getDate()) : 1;\n return this.isSelected({year: this.currentYear, month: month, day: day, selectable: true});\n }\n\n isDateEquals(value, dateMeta) {\n if (value)\n return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;\n else\n return false;\n }\n\n isDateBetween(start, end, dateMeta) {\n let between : boolean = false;\n if (start && end) {\n let date: Date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);\n return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();\n }\n\n return between;\n }\n\n isSingleSelection(): boolean {\n return this.selectionMode === 'single';\n }\n\n isRangeSelection(): boolean {\n return this.selectionMode === 'range';\n }\n\n isMultipleSelection(): boolean {\n return this.selectionMode === 'multiple';\n }\n\n isToday(today, day, month, year): boolean {\n return today.getDate() === day && today.getMonth() === month && today.getFullYear() === year;\n }\n\n isSelectable(day, month, year, otherMonth): boolean {\n let validMin = true;\n let validMax = true;\n let validDate = true;\n let validDay = true;\n\n if (otherMonth && !this.selectOtherMonths) {\n return false;\n }\n\n if (this.minDate) {\n if (this.minDate.getFullYear() > year) {\n validMin = false;\n }\n else if (this.minDate.getFullYear() === year) {\n if (this.minDate.getMonth() > month) {\n validMin = false;\n }\n else if (this.minDate.getMonth() === month) {\n if (this.minDate.getDate() > day) {\n validMin = false;\n }\n }\n }\n }\n\n if (this.maxDate) {\n if (this.maxDate.getFullYear() < year) {\n validMax = false;\n }\n else if (this.maxDate.getFullYear() === year) {\n if (this.maxDate.getMonth() < month) {\n validMax = false;\n }\n else if (this.maxDate.getMonth() === month) {\n if (this.maxDate.getDate() < day) {\n validMax = false;\n }\n }\n }\n }\n\n if (this.disabledDates) {\n validDate = !this.isDateDisabled(day,month,year);\n }\n\n if (this.disabledDays) {\n validDay = !this.isDayDisabled(day,month,year)\n }\n\n return validMin && validMax && validDate && validDay;\n }\n\n isDateDisabled(day:number, month:number, year:number):boolean {\n if (this.disabledDates) {\n for (let disabledDate of this.disabledDates) {\n if (disabledDate.getFullYear() === year && disabledDate.getMonth() === month && disabledDate.getDate() === day) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n isDayDisabled(day:number, month:number, year:number):boolean {\n if (this.disabledDays) {\n let weekday = new Date(year, month, day);\n let weekdayNumber = weekday.getDay();\n return this.disabledDays.indexOf(weekdayNumber) !== -1;\n }\n return false;\n }\n\n onInputFocus(event: Event) {\n this.focus = true;\n if (this.showOnFocus) {\n this.showOverlay();\n }\n this.onFocus.emit(event);\n }\n\n onInputClick() {\n if (this.overlay && this.autoZIndex) {\n this.overlay.style.zIndex = String(this.baseZIndex + (++DomHandler.zindex));\n }\n\n if (this.showOnFocus && !this.overlayVisible) {\n this.showOverlay();\n }\n }\n\n onInputBlur(event: Event) {\n this.focus = false;\n this.onBlur.emit(event);\n if (!this.keepInvalid) {\n this.updateInputfield();\n }\n this.onModelTouched();\n }\n\n onButtonClick(event, inputfield) {\n if (!this.overlayVisible) {\n inputfield.focus();\n this.showOverlay();\n }\n else {\n this.hideOverlay();\n }\n }\n\n onPrevButtonClick(event) {\n this.navigationState = {backward: true, button: true};\n this.navBackward(event);\n }\n\n onNextButtonClick(event) {\n this.navigationState = {backward: false, button: true};\n this.navForward(event);\n }\n\n onContainerButtonKeydown(event) {\n switch (event.which) {\n //tab\n case 9:\n if (!this.inline) {\n this.trapFocus(event);\n }\n break;\n\n //escape\n case 27:\n this.overlayVisible = false;\n event.preventDefault();\n break;\n\n default:\n //Noop\n break;\n }\n }\n\n onInputKeydown(event) {\n this.isKeydown = true;\n if (event.keyCode === 40 && this.contentViewChild) {\n this.trapFocus(event);\n }\n else if (event.keyCode === 27) {\n if (this.overlayVisible) {\n this.overlayVisible = false;\n event.preventDefault();\n }\n }\n else if (event.keyCode === 9 && this.contentViewChild) {\n DomHandler.getFocusableElements(this.contentViewChild.nativeElement).forEach(el => el.tabIndex = '-1');\n if (this.overlayVisible) {\n this.overlayVisible = false;\n }\n }\n }\n\n onDateCellKeydown(event, date, groupIndex) {\n const cellContent = event.currentTarget;\n const cell = cellContent.parentElement;\n\n switch (event.which) {\n //down arrow\n case 40: {\n cellContent.tabIndex = '-1';\n let cellIndex = DomHandler.index(cell);\n let nextRow = cell.parentElement.nextElementSibling;\n if (nextRow) {\n let focusCell = nextRow.children[cellIndex].children[0];\n if (DomHandler.hasClass(focusCell, 'p-disabled')) {\n this.navigationState = {backward: false};\n this.navForward(event);\n }\n else {\n nextRow.children[cellIndex].children[0].tabIndex = '0';\n nextRow.children[cellIndex].children[0].focus();\n }\n }\n else {\n this.navigationState = {backward: false};\n this.navForward(event);\n }\n event.preventDefault();\n break;\n }\n\n //up arrow\n case 38: {\n cellContent.tabIndex = '-1';\n let cellIndex = DomHandler.index(cell);\n let prevRow = cell.parentElement.previousElementSibling;\n if (prevRow) {\n let focusCell = prevRow.children[cellIndex].children[0];\n if (DomHandler.hasClass(focusCell, 'p-disabled')) {\n this.navigationState = {backward: true};\n this.navBackward(event);\n }\n else {\n focusCell.tabIndex = '0';\n focusCell.focus();\n }\n }\n else {\n this.navigationState = {backward: true};\n this.navBackward(event);\n }\n event.preventDefault();\n break;\n }\n\n //left arrow\n case 37: {\n cellContent.tabIndex = '-1';\n let prevCell = cell.previousElementSibling;\n if (prevCell) {\n let focusCell = prevCell.children[0];\n if (DomHandler.hasClass(focusCell, 'p-disabled') || DomHandler.hasClass(focusCell.parentElement, 'p-datepicker-weeknumber')) {\n this.navigateToMonth(true, groupIndex);\n }\n else {\n focusCell.tabIndex = '0';\n focusCell.focus();\n }\n }\n else {\n this.navigateToMonth(true, groupIndex);\n }\n event.preventDefault();\n break;\n }\n\n //right arrow\n case 39: {\n cellContent.tabIndex = '-1';\n let nextCell = cell.nextElementSibling;\n if (nextCell) {\n let focusCell = nextCell.children[0];\n if (DomHandler.hasClass(focusCell, 'p-disabled')) {\n this.navigateToMonth(false, groupIndex);\n }\n else {\n focusCell.tabIndex = '0';\n focusCell.focus();\n }\n }\n else {\n this.navigateToMonth(false, groupIndex);\n }\n event.preventDefault();\n break;\n }\n\n //enter\n case 13: {\n this.onDateSelect(event, date);\n event.preventDefault();\n break;\n }\n\n //escape\n case 27: {\n this.overlayVisible = false;\n event.preventDefault();\n break;\n }\n\n //tab\n case 9: {\n if (!this.inline) {\n this.trapFocus(event);\n }\n break;\n }\n\n default:\n //no op\n break;\n }\n }\n\n onMonthCellKeydown(event, index) {\n const cell = event.currentTarget;\n switch (event.which) {\n //arrows\n case 38:\n case 40: {\n cell.tabIndex = '-1';\n var cells = cell.parentElement.children;\n var cellIndex = DomHandler.index(cell);\n let nextCell = cells[event.which === 40 ? cellIndex + 3 : cellIndex -3];\n if (nextCell) {\n nextCell.tabIndex = '0';\n nextCell.focus();\n }\n event.preventDefault();\n break;\n }\n\n //left arrow\n case 37: {\n cell.tabIndex = '-1';\n let prevCell = cell.previousElementSibling;\n if (prevCell) {\n prevCell.tabIndex = '0';\n prevCell.focus();\n }\n event.preventDefault();\n break;\n }\n\n //right arrow\n case 39: {\n cell.tabIndex = '-1';\n let nextCell = cell.nextElementSibling;\n if (nextCell) {\n nextCell.tabIndex = '0';\n nextCell.focus();\n }\n event.preventDefault();\n break;\n }\n\n //enter\n case 13: {\n this.onMonthSelect(event, index);\n event.preventDefault();\n break;\n }\n\n //escape\n case 27: {\n this.overlayVisible = false;\n event.preventDefault();\n break;\n }\n\n //tab\n case 9: {\n if (!this.inline) {\n this.trapFocus(event);\n }\n break;\n }\n\n default:\n //no op\n break;\n }\n }\n\n navigateToMonth(prev, groupIndex) {\n if (prev) {\n if (this.numberOfMonths === 1 || (groupIndex === 0)) {\n this.navigationState = {backward: true};\n this.navBackward(event);\n }\n else {\n let prevMonthContainer = this.contentViewChild.nativeElement.children[groupIndex - 1];\n let cells = DomHandler.find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');\n let focusCell = cells[cells.length - 1];\n focusCell.tabIndex = '0';\n focusCell.focus();\n }\n }\n else {\n if (this.numberOfMonths === 1 || (groupIndex === this.numberOfMonths - 1)) {\n this.navigationState = {backward: false};\n this.navForward(event);\n }\n else {\n let nextMonthContainer = this.contentViewChild.nativeElement.children[groupIndex + 1];\n let focusCell = DomHandler.findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');\n focusCell.tabIndex = '0';\n focusCell.focus();\n }\n }\n }\n\n updateFocus() {\n let cell;\n if (this.navigationState) {\n if (this.navigationState.button) {\n this.initFocusableCell();\n\n if (this.navigationState.backward)\n DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-prev').focus();\n else\n DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-next').focus();\n }\n else {\n if (this.navigationState.backward) {\n let cells = DomHandler.find(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');\n cell = cells[cells.length - 1];\n }\n else {\n cell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');\n }\n\n if (cell) {\n cell.tabIndex = '0';\n cell.focus();\n }\n }\n\n this.navigationState = null;\n }\n else {\n this.initFocusableCell();\n }\n }\n\n initFocusableCell() {\n let cell;\n if (this.view === 'month') {\n let cells = DomHandler.find(this.contentViewChild.nativeElement, '.p-monthpicker .p-monthpicker-month:not(.p-disabled)');\n let selectedCell= DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-monthpicker .p-monthpicker-month.p-highlight');\n cells.forEach(cell => cell.tabIndex = -1);\n cell = selectedCell || cells[0];\n\n if (cells.length === 0) {\n let disabledCells = DomHandler.find(this.contentViewChild.nativeElement, '.p-monthpicker .p-monthpicker-month.p-disabled[tabindex = \"0\"]');\n disabledCells.forEach(cell => cell.tabIndex = -1);\n }\n }\n else {\n cell = DomHandler.findSingle(this.contentViewChild.nativeElement, 'span.p-highlight');\n if (!cell) {\n let todayCell = DomHandler.findSingle(this.contentViewChild.nativeElement, 'td.p-datepicker-today span:not(.p-disabled):not(.p-ink)');\n if (todayCell)\n cell = todayCell;\n else\n cell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');\n }\n }\n\n if (cell) {\n cell.tabIndex = '0';\n }\n }\n\n trapFocus(event) {\n let focusableElements = DomHandler.getFocusableElements(this.contentViewChild.nativeElement);\n\n if (focusableElements && focusableElements.length > 0) {\n if (!focusableElements[0].ownerDocument.activeElement) {\n focusableElements[0].focus();\n }\n else {\n let focusedIndex = focusableElements.indexOf(focusableElements[0].ownerDocument.activeElement);\n\n if (event.shiftKey) {\n if (focusedIndex == -1 || focusedIndex === 0) {\n if (this.focusTrap){\n focusableElements[focusableElements.length - 1].focus();\n }\n else {\n if (focusedIndex === -1)\n return this.hideOverlay();\n else if (focusedIndex === 0)\n return;\n }\n }\n else {\n focusableElements[focusedIndex - 1].focus();\n }\n }\n else {\n if (focusedIndex == -1 || focusedIndex === (focusableElements.length - 1)) {\n if (!this.focusTrap && focusedIndex != -1)\n return this.hideOverlay();\n else\n focusableElements[0].focus();\n }\n else {\n focusableElements[focusedIndex + 1].focus();\n }\n }\n }\n }\n\n event.preventDefault();\n }\n\n onMonthDropdownChange(m: string) {\n this.currentMonth = parseInt(m);\n this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });\n this.createMonths(this.currentMonth, this.currentYear);\n }\n\n onYearDropdownChange(y: string) {\n this.currentYear = parseInt(y);\n this.onYearChange.emit({ month: this.currentMonth + 1, year: this.currentYear });\n this.createMonths(this.currentMonth, this.currentYear);\n }\n\n convertTo24Hour = function (hours: number, pm: boolean) {\n if (this.hourFormat == '12') {\n if (hours === 12) {\n return (pm ? 12 : 0);\n } else {\n return (pm ? hours + 12 : hours);\n }\n }\n return hours;\n }\n\n validateTime(hour: number, minute: number, second: number, pm: boolean) {\n let value = this.value;\n const convertedHour = this.convertTo24Hour(hour, pm);\n if (this.isRangeSelection()) {\n value = this.value[1] || this.value[0];\n }\n if (this.isMultipleSelection()) {\n value = this.value[this.value.length - 1];\n }\n const valueDateString = value ? value.toDateString() : null;\n if (this.minDate && valueDateString && this.minDate.toDateString() === valueDateString) {\n if (this.minDate.getHours() > convertedHour) {\n return false;\n }\n if (this.minDate.getHours() === convertedHour) {\n if (this.minDate.getMinutes() > minute) {\n return false;\n }\n if (this.minDate.getMinutes() === minute) {\n if (this.minDate.getSeconds() > second) {\n return false;\n }\n }\n }\n }\n\n if (this.maxDate && valueDateString && this.maxDate.toDateString() === valueDateString) {\n if (this.maxDate.getHours() < convertedHour) {\n return false;\n }\n if (this.maxDate.getHours() === convertedHour) {\n if (this.maxDate.getMinutes() < minute) {\n return false;\n }\n if (this.maxDate.getMinutes() === minute) {\n if (this.maxDate.getSeconds() < second) {\n return false;\n }\n }\n }\n }\n return true;\n }\n\n\n incrementHour(event) {\n const prevHour = this.currentHour;\n let newHour = this.currentHour + this.stepHour;\n let newPM = this.pm;\n\n if (this.hourFormat == '24')\n newHour = (newHour >= 24) ? (newHour - 24) : newHour;\n else if (this.hourFormat == '12') {\n // Before the AM/PM break, now after\n if (prevHour < 12 && newHour > 11) {\n newPM= !this.pm;\n }\n newHour = (newHour >= 13) ? (newHour - 12) : newHour;\n }\n\n if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {\n this.currentHour = newHour;\n this.pm = newPM;\n }\n event.preventDefault();\n }\n\n onTimePickerElementMouseDown(event: Event, type: number, direction: number) {\n if (!this.disabled) {\n this.repeat(event, null, type, direction);\n event.preventDefault();\n }\n }\n\n onTimePickerElementMouseUp(event: Event) {\n if (!this.disabled) {\n this.clearTimePickerTimer();\n this.updateTime();\n }\n }\n\n onTimePickerElementMouseOut(event: Event) {\n if (!this.disabled && this.timePickerTimer) {\n this.clearTimePickerTimer();\n this.updateTime();\n }\n }\n\n repeat(event: Event, interval: number, type: number, direction: number) {\n let i = interval||500;\n\n this.clearTimePickerTimer();\n this.timePickerTimer = setTimeout(() => {\n this.repeat(event, 100, type, direction);\n this.cd.markForCheck();\n }, i);\n\n switch(type) {\n case 0:\n if (direction === 1)\n this.incrementHour(event);\n else\n this.decrementHour(event);\n break;\n\n case 1:\n if (direction === 1)\n this.incrementMinute(event);\n else\n this.decrementMinute(event);\n break;\n\n case 2:\n if (direction === 1)\n this.incrementSecond(event);\n else\n this.decrementSecond(event);\n break;\n }\n\n this.updateInputfield();\n }\n\n clearTimePickerTimer() {\n if (this.timePickerTimer) {\n clearTimeout(this.timePickerTimer);\n }\n }\n\n decrementHour(event) {\n let newHour = this.currentHour - this.stepHour;\n let newPM = this.pm\n\n if (this.hourFormat == '24')\n newHour = (newHour < 0) ? (24 + newHour) : newHour;\n else if (this.hourFormat == '12') {\n // If we were at noon/midnight, then switch\n if (this.currentHour === 12) {\n newPM = !this.pm;\n }\n newHour = (newHour <= 0) ? (12 + newHour) : newHour;\n }\n\n if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {\n this.currentHour = newHour;\n this.pm = newPM;\n }\n\n event.preventDefault();\n }\n\n incrementMinute(event) {\n let newMinute = this.currentMinute + this.stepMinute;\n newMinute = (newMinute > 59) ? newMinute - 60 : newMinute;\n if (this.validateTime(this.currentHour, newMinute, this.currentSecond, this.pm)) {\n this.currentMinute = newMinute;\n }\n\n event.preventDefault();\n }\n\n decrementMinute(event) {\n let newMinute = this.currentMinute - this.stepMinute;\n newMinute = (newMinute < 0) ? 60 + newMinute : newMinute;\n if (this.validateTime(this.currentHour, newMinute, this.currentSecond, this.pm)) {\n this.currentMinute = newMinute;\n }\n\n event.preventDefault();\n }\n\n incrementSecond(event) {\n let newSecond = this.currentSecond + this.stepSecond;\n newSecond = (newSecond > 59) ? newSecond - 60 : newSecond;\n if (this.validateTime(this.currentHour, this.currentMinute, newSecond, this.pm)) {\n this.currentSecond = newSecond;\n }\n\n event.preventDefault();\n }\n\n decrementSecond(event) {\n let newSecond = this.currentSecond - this.stepSecond;\n newSecond = (newSecond < 0) ? 60 + newSecond : newSecond;\n if (this.validateTime(this.currentHour, this.currentMinute, newSecond, this.pm)) {\n this.currentSecond = newSecond;\n }\n\n event.preventDefault();\n }\n\n updateTime() {\n let value = this.value;\n if (this.isRangeSelection()) {\n value = this.value[1] || this.value[0];\n }\n if (this.isMultipleSelection()) {\n value = this.value[this.value.length - 1];\n }\n value = value ? new Date(value.getTime()) : new Date();\n\n if (this.hourFormat == '12') {\n if (this.currentHour === 12)\n value.setHours(this.pm ? 12 : 0);\n else\n value.setHours(this.pm ? this.currentHour + 12 : this.currentHour);\n }\n else {\n value.setHours(this.currentHour);\n }\n\n value.setMinutes(this.currentMinute);\n value.setSeconds(this.currentSecond);\n if (this.isRangeSelection()) {\n if (this.value[1])\n value = [this.value[0], value];\n else\n value = [value, null];\n }\n\n if (this.isMultipleSelection()){\n value = [...this.value.slice(0, -1), value];\n }\n\n this.updateModel(value);\n this.onSelect.emit(value);\n this.updateInputfield();\n }\n\n toggleAMPM(event) {\n const newPM = !this.pm;\n if (this.validateTime(this.currentHour, this.currentMinute, this.currentSecond, newPM)) {\n this.pm = newPM;\n this.updateTime();\n }\n event.preventDefault();\n }\n\n onUserInput(event) {\n // IE 11 Workaround for input placeholder : https://github.com/primefaces/primeng/issues/2026\n if (!this.isKeydown) {\n return;\n }\n this.isKeydown = false;\n\n let val = event.target.value;\n try {\n let value = this.parseValueFromString(val);\n if (this.isValidSelection(value)) {\n this.updateModel(value);\n this.updateUI();\n }\n }\n catch(err) {\n //invalid date\n this.updateModel(null);\n }\n\n this.filled = val != null && val.length;\n this.onInput.emit(event);\n }\n\n isValidSelection(value): boolean {\n let isValid = true;\n if (this.isSingleSelection()) {\n if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {\n isValid = false;\n }\n } else if (value.every(v => this.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false))) {\n if (this.isRangeSelection()) {\n isValid = value.length > 1 && value[1] > value[0] ? true : false;\n }\n }\n return isValid;\n }\n\n parseValueFromString(text: string): Date | Date[]{\n if (!text || text.trim().length === 0) {\n return null;\n }\n\n let value: any;\n\n if (this.isSingleSelection()) {\n value = this.parseDateTime(text);\n }\n else if (this.isMultipleSelection()) {\n let tokens = text.split(this.multipleSeparator);\n value = [];\n for (let token of tokens) {\n value.push(this.parseDateTime(token.trim()));\n }\n }\n else if (this.isRangeSelection()) {\n let tokens = text.split(' '+this.rangeSeparator +' ');\n value = [];\n for (let i = 0; i < tokens.length; i++) {\n value[i] = this.parseDateTime(tokens[i].trim());\n }\n }\n\n return value;\n }\n\n parseDateTime(text): Date {\n let date: Date;\n let parts: string[] = text.split(' ');\n\n if (this.timeOnly) {\n date = new Date();\n this.populateTime(date, parts[0], parts[1]);\n }\n else {\n const dateFormat = this.getDateFormat();\n if (this.showTime) {\n let ampm = this.hourFormat == '12' ? parts.pop() : null;\n let timeString = parts.pop();\n\n date = this.parseDate(parts.join(' '), dateFormat);\n this.populateTime(date, timeString, ampm);\n }\n else {\n date = this.parseDate(text, dateFormat);\n }\n }\n\n return date;\n }\n\n populateTime(value, timeString, ampm) {\n if (this.hourFormat == '12' && !ampm) {\n throw 'Invalid Time';\n }\n\n this.pm = (ampm === 'PM' || ampm === 'pm');\n let time = this.parseTime(timeString);\n value.setHours(time.hour);\n value.setMinutes(time.minute);\n value.setSeconds(time.second);\n }\n\n updateUI() {\n let val = this.value||this.defaultDate||new Date();\n if (Array.isArray(val)){\n val = val[0];\n }\n\n this.currentMonth = val.getMonth();\n this.currentYear = val.getFullYear();\n this.createMonths(this.currentMonth, this.currentYear);\n\n if (this.showTime||this.timeOnly) {\n this.setCurrentHourPM(val.getHours());\n this.currentMinute = val.getMinutes();\n this.currentSecond = val.getSeconds();\n }\n }\n\n showOverlay() {\n if (!this.overlayVisible) {\n this.updateUI();\n this.overlayVisible = true;\n }\n }\n\n hideOverlay() {\n this.overlayVisible = false;\n this.clearTimePickerTimer();\n\n if (this.touchUI) {\n this.disableModality();\n }\n\n this.cd.markForCheck();\n }\n\n toggle() {\n if (!this.inline){\n if (!this.overlayVisible) {\n this.showOverlay();\n this.inputfieldViewChild.nativeElement.focus();\n }\n else {\n this.hideOverlay();\n }\n }\n }\n\n onOverlayAnimationStart(event: AnimationEvent) {\n switch (event.toState) {\n case 'visible':\n case 'visibleTouchUI':\n if (!this.inline) {\n this.overlay = event.element;\n this.appendOverlay();\n if (this.autoZIndex) {\n this.overlay.style.zIndex = String(this.baseZIndex + (++DomHandler.zindex));\n }\n this.alignOverlay();\n this.onShow.emit(event);\n }\n break;\n\n case 'void':\n this.onOverlayHide();\n this.onClose.emit(event);\n break;\n }\n }\n\n onOverlayAnimationDone(event: AnimationEvent) {\n switch (event.toState) {\n case 'visible':\n case 'visibleTouchUI':\n if (!this.inline) {\n this.bindDocumentClickListener();\n this.bindDocumentResizeListener();\n this.bindScrollListener();\n }\n break;\n }\n }\n\n appendOverlay() {\n if (this.appendTo) {\n if (this.appendTo === 'body')\n document.body.appendChild(this.overlay);\n else\n DomHandler.appendChild(this.overlay, this.appendTo);\n }\n }\n\n restoreOverlayAppend() {\n if (this.overlay && this.appendTo) {\n this.el.nativeElement.appendChild(this.overlay);\n }\n }\n\n alignOverlay() {\n if (this.touchUI) {\n this.enableModality(this.overlay);\n }\n else {\n if (this.appendTo)\n DomHandler.absolutePosition(this.overlay, this.inputfieldViewChild.nativeElement);\n else\n DomHandler.relativePosition(this.overlay, this.inputfieldViewChild.nativeElement);\n }\n }\n\n enableModality(element) {\n if (!this.mask) {\n this.mask = document.createElement('div');\n this.mask.style.zIndex = String(parseInt(element.style.zIndex) - 1);\n let maskStyleClass = 'p-component-overlay p-datepicker-mask p-datepicker-mask-scrollblocker';\n DomHandler.addMultipleClasses(this.mask, maskStyleClass);\n\n\t\t\tthis.maskClickListener = this.renderer.listen(this.mask, 'click', (event: any) => {\n this.disableModality();\n });\n document.body.appendChild(this.mask);\n DomHandler.addClass(document.body, 'p-overflow-hidden');\n }\n }\n\n disableModality() {\n if (this.mask) {\n document.body.removeChild(this.mask);\n let bodyChildren = document.body.children;\n let hasBlockerMasks: boolean;\n for (let i = 0; i < bodyChildren.length; i++) {\n let bodyChild = bodyChildren[i];\n if (DomHandler.hasClass(bodyChild, 'p-datepicker-mask-scrollblocker')) {\n hasBlockerMasks = true;\n break;\n }\n }\n\n if (!hasBlockerMasks) {\n DomHandler.removeClass(document.body, 'p-overflow-hidden');\n }\n\n this.unbindMaskClickListener();\n\n this.mask = null;\n }\n }\n\n unbindMaskClickListener() {\n if (this.maskClickListener) {\n this.maskClickListener();\n this.maskClickListener = null;\n\t\t}\n }\n\n writeValue(value: any) : void {\n this.value = value;\n if (this.value && typeof this.value === 'string') {\n this.value = this.parseValueFromString(this.value);\n }\n\n this.updateInputfield();\n this.updateUI();\n this.cd.markForCheck();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val: boolean): void {\n this.disabled = val;\n this.cd.markForCheck();\n }\n\n getDateFormat() {\n return this.dateFormat;\n }\n\n // Ported from jquery-ui datepicker formatDate\n formatDate(date, format) {\n if (!date) {\n return '';\n }\n\n let iFormat;\n const lookAhead = (match) => {\n const matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n },\n formatNumber = (match, value, len) => {\n let num = '' + value;\n if (lookAhead(match)) {\n while (num.length < len) {\n num = '0' + num;\n }\n }\n return num;\n },\n formatName = (match, value, shortNames, longNames) => {\n return (lookAhead(match) ? longNames[value] : shortNames[value]);\n };\n let output = '';\n let literal = false;\n\n if (date) {\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === '\\'' && !lookAhead('\\'')) {\n literal = false;\n } else {\n output += format.charAt(iFormat);\n }\n } else {\n switch (format.charAt(iFormat)) {\n case 'd':\n output += formatNumber('d', date.getDate(), 2);\n break;\n case 'D':\n output += formatName('D', date.getDay(), this.getTranslation(TranslationKeys.DAY_NAMES_SHORT), this.getTranslation(TranslationKeys.DAY_NAMES));\n break;\n case 'o':\n output += formatNumber('o',\n Math.round((\n new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -\n new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);\n break;\n case 'm':\n output += formatNumber('m', date.getMonth() + 1, 2);\n break;\n case 'M':\n output += formatName('M',date.getMonth(), this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT), this.getTranslation(TranslationKeys.MONTH_NAMES));\n break;\n case 'y':\n output += lookAhead('y') ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);\n break;\n case '@':\n output += date.getTime();\n break;\n case '!':\n output += date.getTime() * 10000 + this.ticksTo1970;\n break;\n case '\\'':\n if (lookAhead('\\'')) {\n output += '\\'';\n } else {\n literal = true;\n }\n break;\n default:\n output += format.charAt(iFormat);\n }\n }\n }\n }\n return output;\n }\n\n formatTime(date) {\n if (!date) {\n return '';\n }\n\n let output = '';\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n\n if (this.hourFormat == '12' && hours > 11 && hours != 12) {\n hours-=12;\n }\n\n if (this.hourFormat == '12') {\n output += hours === 0 ? 12 : (hours < 10) ? '0' + hours : hours;\n } else {\n output += (hours < 10) ? '0' + hours : hours;\n }\n output += ':';\n output += (minutes < 10) ? '0' + minutes : minutes;\n\n if (this.showSeconds) {\n output += ':';\n output += (seconds < 10) ? '0' + seconds : seconds;\n }\n\n if (this.hourFormat == '12') {\n output += date.getHours() > 11 ? ' PM' : ' AM';\n }\n\n return output;\n }\n\n parseTime(value) {\n let tokens: string[] = value.split(':');\n let validTokenLength = this.showSeconds ? 3 : 2;\n\n if (tokens.length !== validTokenLength) {\n throw \"Invalid time\";\n }\n\n let h = parseInt(tokens[0]);\n let m = parseInt(tokens[1]);\n let s = this.showSeconds ? parseInt(tokens[2]) : null;\n\n if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || (this.hourFormat == '12' && h > 12) || (this.showSeconds && (isNaN(s) || s > 59))) {\n throw \"Invalid time\";\n }\n else {\n if (this.hourFormat == '12') {\n if (h !== 12 && this.pm) {\n h += 12;\n }\n else if (!this.pm && h === 12) {\n h -= 12;\n }\n }\n\n return {hour: h, minute: m, second: s};\n }\n }\n\n // Ported from jquery-ui datepicker parseDate\n parseDate(value, format) {\n if (format == null || value == null) {\n throw \"Invalid arguments\";\n }\n\n value = (typeof value === \"object\" ? value.toString() : value + \"\");\n if (value === \"\") {\n return null;\n }\n\n let iFormat, dim, extra,\n iValue = 0,\n shortYearCutoff = (typeof this.shortYearCutoff !== \"string\" ? this.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.shortYearCutoff, 10)),\n year = -1,\n month = -1,\n day = -1,\n doy = -1,\n literal = false,\n date,\n lookAhead = (match) => {\n let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n },\n getNumber = (match) => {\n let isDoubled = lookAhead(match),\n size = (match === \"@\" ? 14 : (match === \"!\" ? 20 :\n (match === \"y\" && isDoubled ? 4 : (match === \"o\" ? 3 : 2)))),\n minSize = (match === \"y\" ? size : 1),\n digits = new RegExp(\"^\\\\d{\" + minSize + \",\" + size + \"}\"),\n num = value.substring(iValue).match(digits);\n if (!num) {\n throw \"Missing number at position \" + iValue;\n }\n iValue += num[ 0 ].length;\n return parseInt(num[ 0 ], 10);\n },\n getName = (match, shortNames, longNames) => {\n let index = -1;\n let arr = lookAhead(match) ? longNames : shortNames;\n let names = [];\n\n for (let i = 0; i < arr.length; i++) {\n names.push([i,arr[i]]);\n }\n names.sort((a,b) => {\n return -(a[ 1 ].length - b[ 1 ].length);\n });\n\n for (let i = 0; i < names.length; i++) {\n let name = names[i][1];\n if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {\n index = names[i][0];\n iValue += name.length;\n break;\n }\n }\n\n if (index !== -1) {\n return index + 1;\n } else {\n throw \"Unknown name at position \" + iValue;\n }\n },\n checkLiteral = () => {\n if (value.charAt(iValue) !== format.charAt(iFormat)) {\n throw \"Unexpected literal at position \" + iValue;\n }\n iValue++;\n };\n\n if (this.view === 'month') {\n day = 1;\n }\n\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === \"'\" && !lookAhead(\"'\")) {\n literal = false;\n } else {\n checkLiteral();\n }\n } else {\n switch (format.charAt(iFormat)) {\n case \"d\":\n day = getNumber(\"d\");\n break;\n case \"D\":\n getName(\"D\", this.getTranslation(TranslationKeys.DAY_NAMES_SHORT), this.getTranslation(TranslationKeys.DAY_NAMES));\n break;\n case \"o\":\n doy = getNumber(\"o\");\n break;\n case \"m\":\n month = getNumber(\"m\");\n break;\n case \"M\":\n month = getName(\"M\", this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT), this.getTranslation(TranslationKeys.MONTH_NAMES));\n break;\n case \"y\":\n year = getNumber(\"y\");\n break;\n case \"@\":\n date = new Date(getNumber(\"@\"));\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n case \"!\":\n date = new Date((getNumber(\"!\") - this.ticksTo1970) / 10000);\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n case \"'\":\n if (lookAhead(\"'\")) {\n checkLiteral();\n } else {\n literal = true;\n }\n break;\n default:\n checkLiteral();\n }\n }\n }\n\n if (iValue < value.length) {\n extra = value.substr(iValue);\n if (!/^\\s+/.test(extra)) {\n throw \"Extra/unparsed characters found in date: \" + extra;\n }\n }\n\n if (year === -1) {\n year = new Date().getFullYear();\n } else if (year < 100) {\n year += new Date().getFullYear() - new Date().getFullYear() % 100 +\n (year <= shortYearCutoff ? 0 : -100);\n }\n\n if (doy > -1) {\n month = 1;\n day = doy;\n do {\n dim = this.getDaysCountInMonth(year, month - 1);\n if (day <= dim) {\n break;\n }\n month++;\n day -= dim;\n } while (true);\n }\n\n date = this.daylightSavingAdjust(new Date(year, month - 1, day));\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {\n throw \"Invalid date\"; // E.g. 31/02/00\n }\n\n return date;\n }\n\n daylightSavingAdjust(date) {\n if (!date) {\n return null;\n }\n\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\n\n return date;\n }\n\n updateFilledState() {\n this.filled = this.inputFieldValue && this.inputFieldValue != '';\n }\n\n onTodayButtonClick(event) {\n let date: Date = new Date();\n let dateMeta = {day: date.getDate(), month: date.getMonth(), year: date.getFullYear(), otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear, today: true, selectable: true};\n\n this.onDateSelect(event, dateMeta);\n this.onTodayClick.emit(event);\n }\n\n onClearButtonClick(event) {\n this.updateModel(null);\n this.updateInputfield();\n this.hideOverlay();\n this.onClearClick.emit(event);\n }\n\n bindDocumentClickListener() {\n if (!this.documentClickListener) {\n this.zone.runOutsideAngular(() => {\n const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : 'document';\n\n this.documentClickListener = this.renderer.listen(documentTarget, 'click', (event) => {\n if (this.isOutsideClicked(event) && this.overlayVisible) {\n this.zone.run(() => {\n this.hideOverlay();\n this.onClickOutside.emit(event);\n\n this.cd.markForCheck();\n });\n }\n\n });\n });\n }\n }\n\n unbindDocumentClickListener() {\n if (this.documentClickListener) {\n this.documentClickListener();\n this.documentClickListener = null;\n }\n }\n\n bindDocumentResizeListener() {\n if (!this.documentResizeListener && !this.touchUI) {\n this.documentResizeListener = this.onWindowResize.bind(this);\n window.addEventListener('resize', this.documentResizeListener);\n }\n }\n\n unbindDocumentResizeListener() {\n if (this.documentResizeListener) {\n window.removeEventListener('resize', this.documentResizeListener);\n this.documentResizeListener = null;\n }\n }\n\n bindScrollListener() {\n if (!this.scrollHandler) {\n this.scrollHandler = new ConnectedOverlayScrollHandler(this.containerViewChild.nativeElement, () => {\n if (this.overlayVisible) {\n this.hideOverlay();\n }\n });\n }\n\n this.scrollHandler.bindScrollListener();\n }\n\n unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n }\n\n isOutsideClicked(event: Event) {\n return !(this.el.nativeElement.isSameNode(event.target) || this.isNavIconClicked(event) || \n this.el.nativeElement.contains(event.target) || (this.overlay && this.overlay.contains( event.target)));\n }\n\n isNavIconClicked(event: Event) {\n return (DomHandler.hasClass(event.target, 'p-datepicker-prev') || DomHandler.hasClass(event.target, 'p-datepicker-prev-icon')\n || DomHandler.hasClass(event.target, 'p-datepicker-next') || DomHandler.hasClass(event.target, 'p-datepicker-next-icon'));\n }\n\n onWindowResize() {\n if (this.overlayVisible && !DomHandler.isAndroid()) {\n this.hideOverlay();\n }\n }\n\n onOverlayHide() {\n this.unbindDocumentClickListener();\n this.unbindMaskClickListener();\n this.unbindDocumentResizeListener();\n this.unbindScrollListener();\n this.overlay = null;\n this.disableModality();\n }\n\n ngOnDestroy() {\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n\n this.clearTimePickerTimer();\n this.restoreOverlayAppend();\n this.onOverlayHide();\n }\n}\n\n@NgModule({\n imports: [CommonModule,ButtonModule,SharedModule,RippleModule],\n exports: [Calendar,ButtonModule,SharedModule],\n declarations: [Calendar]\n})\nexport class CalendarModule { }\n"]}