Skip to content

Commit

Permalink
Merge pull request #13349 from SoyDiego/fix-error-calendar-component
Browse files Browse the repository at this point in the history
[#13348] - Fixed calendar component, added yearOptions onInit
  • Loading branch information
gucal authored Aug 27, 2023
2 parents f3645e4 + 3f1cc93 commit 7cc9946
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,9 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {

overlayVisible: Nullable<boolean>;

onModelChange: Function = () => {};
onModelChange: Function = () => { };

onModelTouched: Function = () => {};
onModelTouched: Function = () => { };

calendarElement: Nullable<HTMLElement | ElementRef>;

Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -3402,4 +3403,4 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
exports: [Calendar, ButtonModule, SharedModule],
declarations: [Calendar]
})
export class CalendarModule {}
export class CalendarModule { }

1 comment on commit 7cc9946

@vercel
Copy link

@vercel vercel bot commented on 7cc9946 Aug 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.