diff --git a/src/App.vue b/src/App.vue index 3dba401..db363d9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,6 +14,7 @@ import googleCalendarPlugin from '@fullcalendar/google-calendar'; import '@fullcalendar/core/main.css'; import '@fullcalendar/daygrid/main.css'; import '@fullcalendar/timegrid/main.css'; +import { EventInput } from '@fullcalendar/core'; const calendars: { [key: string]: string } = { computer_lab: '6mmjp85e4732ru6skf1dda54ls@group.calendar.google.com', @@ -44,6 +45,7 @@ export default class App extends Vue { return { googleCalendarId: id, color: colors.pop(), + eventDataTransform: this.eventDataTransform, }; }), slotLabelFormat: { @@ -57,6 +59,14 @@ export default class App extends Vue { hour12: false, }, }; + + eventDataTransform(eventData: EventInput): EventInput { + const match = eventData.title.match(/([^\/]*) \/ ([^-]*) - (.*)/); + if (match !== null) { + eventData.title = match[3]; + } + return eventData; + } }