views! wow.

This commit is contained in:
lda committed 2025-05-18 00:15:46 +07:00
1 parent 2d5f7ac7b6
commit 02a61145a9
4 files changed
+50 -13

No files matched your search

+20 -7
View File
@@ -1,19 +1,34 @@
import { Calendar } from "@fullcalendar/core";
import iCalendarPlugin from "@fullcalendar/icalendar";
import listPlugin from "@fullcalendar/list";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
// import multiMonthPlugin from "@fullcalendar/multimonth";
const text_field = document.getElementById("ics_file");
const confirm_button = document.getElementById("ics_run");
const cal = document.getElementById("calendar");
const on_click = (_e) => {
confirm_button.addEventListener("click", (_e) => {
console.log("nawgh:", text_field.value);
if (text_field.value) {
const calendar = new Calendar(cal, {
plugins: [listPlugin, iCalendarPlugin],
plugins: [listPlugin, iCalendarPlugin, timeGridPlugin, dayGridPlugin],
initialView: "listWeek",
// multiMonthMaxColumns: 1,
navLinks: true,
headerToolbar: {
left: "prev,next today",
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek", // Add the views you want
},
views: {
dayGridMonth: { buttonText: "Month" },
timeGridWeek: { buttonText: "Week" },
timeGridDay: { buttonText: "Day" },
listWeek: { buttonText: "List" },
},
events: {
url: text_field.value,
format: "ics",
@@ -22,6 +37,4 @@ const on_click = (_e) => {
calendar.render();
}
};
confirm_button.addEventListener("click", on_click);
});