From b1b8448206caacb32863e76adfb68b333a11e539 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Tue, 5 Dec 2017 13:59:47 +0100 Subject: [PATCH] Shorten event titles, 'Berlin' is kind of redundant --- events/calendar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/events/calendar.js b/events/calendar.js index 72b657f..f79e26f 100644 --- a/events/calendar.js +++ b/events/calendar.js @@ -68,6 +68,11 @@ function renderEvent(event, container) { } return val; }; + const cleanTitle = (title) => { + let cleaned = title.replace(/\sBerlin$/, ''); + cleaned = cleaned.replace(/\sUser Group/, ' UG'); + return cleaned; + }; const timeFormat = 'HH:MM'; if (event.allDay) { time.innerHTML = '--:--'; @@ -76,7 +81,7 @@ function renderEvent(event, container) { } code.innerHTML = `C${pad(event.id)}`; - destination.innerHTML = event.title; + destination.innerHTML = cleanTitle(event.title); if (startDate.toDateString() !== prevDate.toDateString()) { status.innerHTML = dateformat(startDate, 'dd.mm.');