Split on space + dash
This commit is contained in:
parent
7fdd5be753
commit
8b8458a33e
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue