You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi/ClientApp/src/app/calendar/components/calendar.component.ts

49 lines
1.3 KiB

import { Component, OnInit } from "@angular/core";
import { CalendarService } from "../../services/calendar.service";
import { ICalendarModel } from "../../interfaces/ICalendar";
import dayGridPlugin from '@fullcalendar/daygrid';
import interactionPlugin from '@fullcalendar/interaction';
@Component({
templateUrl: "./calendar.component.html",
styleUrls: ["./calendar.component.scss"],
})
export class CalendarComponent implements OnInit {
public loadingFlag: boolean;
events: any[];
options: any;
entries: ICalendarModel[];
constructor(private calendarService: CalendarService) { }
public async ngOnInit() {
this.loading()
this.options = {
plugins: [dayGridPlugin, interactionPlugin],
defaultDate: new Date(),
header: {
left: 'prev,next',
center: 'title',
right: 'agendaWeek,month'
},
eventClick: (e: any) => {
e.preventDefault();
}
};
this.entries = await this.calendarService.getCalendarEntries();
this.finishLoading();
}
private loading() {
this.loadingFlag = true;
}
private finishLoading() {
this.loadingFlag = false;
}
}