hi, i have a problem in my calendar.ts it tells me that the function loadCalendar() does not exist but if it exists I do not know what to do, and restart the server cordova but it remains the same, if someone could help me I would appreciate it a lot
export class CalendarPage {
date: any = new Date();
daysInThisMonth: any = void 0;
daysInLastMonth: any= void 0;
daysInNextMonth: any= void 0;
monthNames: string;
currentMonth: any= void 0;
currentYear: any= void 0;
currentDate: any= void 0;
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public calenda : CalendarModule,
public userService : UserServiceProvider,
) { }
@ViewChild(‘mbscCal’)
loadCalendar() {
this.daysInThisMonth = new Array();
this.daysInLastMonth = new Array();
this.daysInNextMonth = new Array();
this.currentMonth = this.monthNames[this.date.getMonth()];
this.currentYear = this.date.getFullYear();
if(this.date.getMonth() === new Date().getMonth()) {
this.currentDate = new Date().getDate();
} else {
this.currentDate = 999;
}
var firstDayThisMonth = new Date(this.date.getFullYear(), this.date.getMonth(), 1).getDay();
var prevNumOfDays = new Date(this.date.getFullYear(), this.date.getMonth(), 0).getDate();
for(let i = prevNumOfDays-(firstDayThisMonth-1); i <= prevNumOfDays; i++) {
this.daysInLastMonth.push(i);
}
var thisNumOfDays = new Date(this.date.getFullYear(), this.date.getMonth()+1, 0).getDate();
for (let i = 0; i < thisNumOfDays; i++) {
this.daysInThisMonth.push(i+1);
}
var lastDayThisMonth = new Date(this.date.getFullYear(), this.date.getMonth()+1, 0).getDay();
var nextNumOfDays = new Date(this.date.getFullYear(), this.date.getMonth()+2, 0).getDate();
for (let i = 0; i < (6-lastDayThisMonth); i++) {
this.daysInNextMonth.push(i+1);
}
var totalDays = this.daysInLastMonth.length+this.daysInThisMonth.length+this.daysInNextMonth.length;
if(totalDays<36) {
for(let i = (7-lastDayThisMonth); i < ((7-lastDayThisMonth)+7); i++) {
this.daysInNextMonth.push(i);
}
}
}
goToLastMonth() {
this.date = new Date(this.date.getFullYear(), this.date.getMonth(), 0);
this.loadCalendar();
}
goToNextMonth() {
this.date = new Date(this.date.getFullYear(), this.date.getMonth()+2, 0);
this.loadCalendar();
}
ionViewDidLoad() {
this.loadCalendar();
}
}