// yarn add @fullcalendar/core // yarn add @fullcalendar/daygrid import { Controller } from "stimulus" import { Calendar } from '@fullcalendar/core'; import dayGridPlugin from '@fullcalendar/daygrid'; import '@fullcalendar/core/main.css' export default class extends Controller { static targets = ["calendar"] initialize() { } connect() { let calendar = new Calendar(this.calendarTarget, { header: { left: 'prev,next today', center: 'title', right: 'dayGridMonth,dayGridWeek,dayGridDay' }, eventLimit: true, views: { dayGridMonth: { eventLimit: 3 } }, events: '/admin/events.json', plugins: [dayGridPlugin] }) calendar.render(); } disconnect() { } }