Split on space + dash

This commit is contained in:
Thomas Forgione 2017-10-04 11:00:19 +02:00
parent 7fdd5be753
commit 8b8458a33e
No known key found for this signature in database
GPG Key ID: C75CD416BD1FFCE1
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ cal.getTotalByCourse = function(user, callback) {
for (let event of calendar.events) { for (let event of calendar.events) {
// Guess name of event, last element of split('-'); // 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]; let name = split[split.length - 1];
if (res[name] === undefined) { if (res[name] === undefined) {