diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index 191dc0ae252..443b5783bac 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -921,9 +921,9 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { overlayVisible: Nullable; - onModelChange: Function = () => {}; + onModelChange: Function = () => { }; - onModelTouched: Function = () => {}; + onModelTouched: Function = () => { }; calendarElement: Nullable; @@ -1033,6 +1033,7 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { this.createResponsiveStyle(); this.currentMonth = date.getMonth(); this.currentYear = date.getFullYear(); + this.yearOptions = []; this.currentView = this.view; if (this.view === 'date') { @@ -2911,12 +2912,12 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { let iFormat!: any; const lookAhead = (match: string) => { - const matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match; - if (matches) { - iFormat++; - } - return matches; - }, + const matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match; + if (matches) { + iFormat++; + } + return matches; + }, formatNumber = (match: string, value: any, len: any) => { let num = '' + value; if (lookAhead(match)) { @@ -3402,4 +3403,4 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { exports: [Calendar, ButtonModule, SharedModule], declarations: [Calendar] }) -export class CalendarModule {} +export class CalendarModule { }