From 2fd3a06a4069f6a29a2374bd846b71f69a570e12 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 16 Mar 2020 22:55:47 -0400 Subject: [PATCH] Add a basic eventDataTransform function to clean up event names --- src/App.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; + } }