From 8b8458a33e51bd61e433161b6a6bfdb2bbbcf843 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 4 Oct 2017 11:00:19 +0200 Subject: [PATCH] Split on space + dash --- utils/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/calendar.js b/utils/calendar.js index 5617747..28e270e 100644 --- a/utils/calendar.js +++ b/utils/calendar.js @@ -273,7 +273,7 @@ cal.getTotalByCourse = function(user, callback) { for (let event of calendar.events) { // Guess name of event, last element of split('-'); - let split = event.name.split('-'); + let split = event.name.split(' -').map(x => x.trim()); let name = split[split.length - 1]; if (res[name] === undefined) {