date(range) select event

This commit is contained in:
Julian Krauser 2024-10-25 17:21:09 +02:00
parent d98afa259e
commit 5c2865a9e5
4 changed files with 34 additions and 5 deletions

13
package-lock.json generated
View file

@ -12,6 +12,7 @@
"@fullcalendar/core": "^6.1.15", "@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15", "@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/timegrid": "^6.1.15",
"@fullcalendar/vue3": "^6.1.15", "@fullcalendar/vue3": "^6.1.15",
"@headlessui/vue": "^1.7.13", "@headlessui/vue": "^1.7.13",
"@heroicons/vue": "^2.1.5", "@heroicons/vue": "^2.1.5",
@ -2440,6 +2441,18 @@
"@fullcalendar/core": "~6.1.15" "@fullcalendar/core": "~6.1.15"
} }
}, },
"node_modules/@fullcalendar/timegrid": {
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.15.tgz",
"integrity": "sha512-61ORr3A148RtxQ2FNG7JKvacyA/TEVZ7z6I+3E9Oeu3dqTf6M928bFcpehRTIK6zIA6Yifs7BeWHgOE9dFnpbw==",
"license": "MIT",
"dependencies": {
"@fullcalendar/daygrid": "~6.1.15"
},
"peerDependencies": {
"@fullcalendar/core": "~6.1.15"
}
},
"node_modules/@fullcalendar/vue3": { "node_modules/@fullcalendar/vue3": {
"version": "6.1.15", "version": "6.1.15",
"resolved": "https://registry.npmjs.org/@fullcalendar/vue3/-/vue3-6.1.15.tgz", "resolved": "https://registry.npmjs.org/@fullcalendar/vue3/-/vue3-6.1.15.tgz",

View file

@ -27,6 +27,7 @@
"@fullcalendar/core": "^6.1.15", "@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15", "@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/timegrid": "^6.1.15",
"@fullcalendar/vue3": "^6.1.15", "@fullcalendar/vue3": "^6.1.15",
"@headlessui/vue": "^1.7.13", "@headlessui/vue": "^1.7.13",
"@heroicons/vue": "^2.1.5", "@heroicons/vue": "^2.1.5",

View file

@ -98,3 +98,6 @@ textarea[disabled] {
.fc-button-active { .fc-button-active {
@apply !bg-red-500 !border-red-500; @apply !bg-red-500 !border-red-500;
} }
.fc-toolbar {
@apply flex-wrap;
}

View file

@ -20,6 +20,7 @@ import MainTemplate from "@/templates/Main.vue";
import FullCalendar from "@fullcalendar/vue3"; import FullCalendar from "@fullcalendar/vue3";
import deLocale from "@fullcalendar/core/locales/de"; import deLocale from "@fullcalendar/core/locales/de";
import dayGridPlugin from "@fullcalendar/daygrid"; import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction"; import interactionPlugin from "@fullcalendar/interaction";
</script> </script>
@ -29,25 +30,36 @@ export default defineComponent({
return { return {
calendarOptions: { calendarOptions: {
locale: deLocale, locale: deLocale,
plugins: [dayGridPlugin, interactionPlugin], plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
initialView: "dayGridMonth", initialView: "dayGridMonth",
headerToolbar: { headerToolbar: {
left: "today", left: "dayGridMonth,timeGridWeek",
center: "title", center: "title",
right: "prev,next", right: "prev,today,next",
}, },
eventDisplay: "block", eventDisplay: "block",
weekends: true, weekends: true,
editable: true, editable: true,
selectable: true, selectable: true,
selectMirror: true, selectMirror: false,
dayMaxEvents: true, dayMaxEvents: true,
weekNumbers: true, weekNumbers: true,
displayEventTime: false, displayEventTime: true,
nowIndicator: true,
weekText: "KW", weekText: "KW",
select: this.select,
eventClick: this.eventClick,
}, },
}; };
}, },
methods: {
select(e: any) {
console.log("s", e);
},
eventClick(e: any) {
console.log("ec", e);
},
},
}); });
/** /**