Corrected bugs
This commit is contained in:
parent
64e1316b1e
commit
7fdd5be753
|
@ -28,7 +28,7 @@ cal.Type = {
|
|||
BE: 5,
|
||||
Examen: 6,
|
||||
},
|
||||
Unkown: 7,
|
||||
Unknown: 7,
|
||||
}
|
||||
|
||||
cal.getTypeName = function(type) {
|
||||
|
@ -71,7 +71,10 @@ cal.getTypeFromName = function(name) {
|
|||
return cal.Type.Other.BE;
|
||||
} else if (name.indexOf("Examen") !== -1) {
|
||||
return cal.Type.Other.Examen;
|
||||
} else {
|
||||
return cal.Type.Unkown;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cal.Event = class {
|
||||
|
@ -281,7 +284,14 @@ cal.getTotalByCourse = function(user, callback) {
|
|||
res[name].totalTdEquivalent = 0;
|
||||
}
|
||||
|
||||
res[name][cal.getTypeName(event.type)]++;
|
||||
let type = event.type;
|
||||
let typeName;
|
||||
if (type === cal.Type.Other.BE || type == cal.Type.Other.Examen) {
|
||||
typeName = "Other";
|
||||
} else {
|
||||
typeName = cal.getTypeName(type);
|
||||
}
|
||||
res[name][typeName]++;
|
||||
res[name].totalTdEquivalent += event.getTdEquivalent();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue