summaryrefslogtreecommitdiffstats
path: root/assets/js
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-05-20 19:58:59 +0200
committersijanec <sijanecantonluka@gmail.com>2020-05-20 19:58:59 +0200
commit2acc46724db65edf60a7316086fe098cc7b3f5b3 (patch)
tree9ba99401e4672d7cc9ecfe5365b3bc3212901713 /assets/js
parentAnother CSS bug fix (diff)
downloadbeziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.tar
beziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.tar.gz
beziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.tar.bz2
beziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.tar.lz
beziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.tar.xz
beziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.tar.zst
beziapp-2acc46724db65edf60a7316086fe098cc7b3f5b3.zip
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/gsec.js29
1 files changed, 20 insertions, 9 deletions
diff --git a/assets/js/gsec.js b/assets/js/gsec.js
index df571f6..088edcb 100644
--- a/assets/js/gsec.js
+++ b/assets/js/gsec.js
@@ -319,15 +319,26 @@ class gsec {
subjects[abkurzung] = subjectName;
}
- var TP = {};
- TP.day = slDayToInt(DAY_REGEX.exec(subFields[3].innerHTML)[1]);
- TP.period = Number(PERIOD_REGEX.exec(subFields[3].innerHTML)[1]);
- var time_range_matches = TIME_RANGE_REGEX.exec(subFields[3].innerHTML);
- TP.from = time_range_matches[1];
- TP.till = time_range_matches[2];
- if (TP.day < 0) { // indexOf vrne -1, če v arrayu ne najde dneva (&nbsp;)
- TP = false;
- }
+ try {
+ var TP = {};
+ TP.day = slDayToInt(DAY_REGEX.exec(subFields[3].innerHTML)[1]);
+ TP.period = Number(PERIOD_REGEX.exec(subFields[3].innerHTML)[1]);
+ var time_range_matches = TIME_RANGE_REGEX.exec(subFields[3].innerHTML);
+ TP.from = time_range_matches[1];
+ TP.till = time_range_matches[2];
+ if (TP.day < 0) { // indexOf vrne -1, če v arrayu ne najde dneva (&nbsp;)
+ TP = false;
+ }
+ } catch (error) {
+ var TP = {};
+ TP.day = slDayToInt(subFields[3].innerHTML.split(", ")[0]);
+ TP.period = Number( subFields[3].innerHTML.split(", ").pop().split(". ura")[0] );
+ TP.from = subFields[3].innerHTML.split("(").pop().split(")")[0].split(" - ")[0];
+ TP.till = subFields[3].innerHTML.split("(").pop().split(")")[0].split(" - ")[1];
+ if (TP.day < 0) { // indexOf vrne -1, če v arrayu ne najde dneva (&nbsp;)
+ TP = false;
+ }
+ }
Teachers[name] = { "subjects" : subjects , "tpMeetings" : TP };
}