diff --git a/utils/calendar.js b/utils/calendar.js index 9d686c5..04ef31f 100644 --- a/utils/calendar.js +++ b/utils/calendar.js @@ -28,8 +28,9 @@ cal.Type = { BE: 5, Examen: 6, Projet: 7, + APP: 8, }, - Unknown: 8, + Unknown: 9, } cal.getTypeName = function(type) { @@ -41,6 +42,7 @@ cal.getTypeName = function(type) { case cal.Type.Other.BE: case cal.Type.Other.Projet: case cal.Type.Other.Examen: + case cal.Type.Other.APP: return "Other"; default: return "Unknown"; } @@ -53,6 +55,7 @@ cal.getFactor = function(type) { case cal.Type.Other.BE: return 1; case cal.Type.Other.Projet: return 1; case cal.Type.Other.Examen: return 0; + case cal.Type.Other.APP: return 1.5; case cal.Type.CTD: return 1.25; case cal.Type.CM: return 1.5; default: return 0; @@ -75,6 +78,8 @@ cal.getTypeFromName = function(name) { return cal.Type.Other.Examen; } else if (name.toLowerCase().indexOf("projet") !== -1) { return cal.Type.Other.Projet; + } else if (name.indexOf("APP") !== -1) { + return cal.Type.Other.APP; } else { return cal.Type.Unkown; } @@ -290,7 +295,7 @@ cal.getTotalByCourse = function(user, callback) { let type = event.type; let typeName; - if (type === cal.Type.Other.BE || type == cal.Type.Other.Examen || type == cal.Type.Other.Projet) { + if (type in cal.Type.Other) { typeName = "Other"; } else { typeName = cal.getTypeName(type);