28 lines
915 B
TypeScript
28 lines
915 B
TypeScript
import { Component } from '@angular/core';
|
|
import { RouterOutlet } from '@angular/router';
|
|
import { FullCalendarModule } from '@fullcalendar/angular';
|
|
import { CalendarOptions } from '@fullcalendar/core'; // useful for typechecking
|
|
import dayGridPlugin from '@fullcalendar/daygrid';
|
|
import interactionPlugin from '@fullcalendar/interaction';
|
|
|
|
@Component({
|
|
selector: 'app-appointment-calendar',
|
|
templateUrl: './appointment-calendar.component.html',
|
|
styleUrl: './appointment-calendar.component.scss'
|
|
})
|
|
export class AppointmentCalendarComponent {
|
|
calendarOptions: CalendarOptions = {
|
|
initialView: 'dayGridMonth',
|
|
plugins: [dayGridPlugin, interactionPlugin],
|
|
dateClick: (arg) => this.handleDateClick(arg),
|
|
events: [
|
|
{ title: 'event 1', date: '2025-01-01' },
|
|
{ title: 'event 2', date: '2025-01-02' }
|
|
]
|
|
};
|
|
|
|
handleDateClick(arg) {
|
|
alert('date click! ' + arg.dateStr)
|
|
}
|
|
}
|