migrated to work with new iserv and units versions
This commit is contained in:
@@ -118,17 +118,30 @@ export class IServService {
|
||||
result.class = grades[0].replace("Jahrgang ", "").toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
switch (result.class) {
|
||||
case "12":
|
||||
result.class = "Q1";
|
||||
break;
|
||||
|
||||
case "13":
|
||||
result.class = "Q2";
|
||||
break;
|
||||
}
|
||||
|
||||
await this.storage.setItem("class", result.class);
|
||||
|
||||
for (let group of groups) {
|
||||
if (!group.includes(".") || !group.toLowerCase().startsWith("q")) continue;
|
||||
result.courses.push(group.split(".")[1]);
|
||||
result.courses.push(group.split(".")[1]
|
||||
.replace("1", "")
|
||||
.replace("2", ""));
|
||||
}
|
||||
|
||||
if (result.class.startsWith("Q")) {
|
||||
const courses: Course[] = [];
|
||||
for (let course of result.courses) {
|
||||
const short = course.substring(1, 3);
|
||||
const short = course.substring(0, 2);
|
||||
const name = this.courseNames[short];
|
||||
if (name == undefined) continue;
|
||||
courses.push({
|
||||
|
||||
@@ -34,6 +34,14 @@ export class SchedulePage implements OnInit {
|
||||
this.timetable = await this.storage.getItem("timetable");
|
||||
|
||||
if (this.timetable == undefined) {
|
||||
this.timetable = {
|
||||
mon: [],
|
||||
tue: [],
|
||||
wed: [],
|
||||
thu: [],
|
||||
fri: []
|
||||
};
|
||||
|
||||
for (let day of ['mon', 'tue', 'wed', 'thu', 'fri']) {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
this.timetable[day].push(undefined);
|
||||
|
||||
@@ -82,7 +82,11 @@ export class SubstitutionPage implements OnInit {
|
||||
|
||||
public hasClass(course: string): boolean {
|
||||
if (!this.filterByClasses) return true;
|
||||
return this.courses.includes(course);
|
||||
if (course == " ") return true;
|
||||
|
||||
return this.courses.includes(course
|
||||
.replace("1", "")
|
||||
.replace("2", ""));
|
||||
}
|
||||
|
||||
public addFakeSubstitution(event: any) {
|
||||
|
||||
Reference in New Issue
Block a user