aboutsummaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/models')
-rw-r--r--src/models/EventInfo.ts6
-rw-r--r--src/models/PeerTeacher.ts4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/models/EventInfo.ts b/src/models/EventInfo.ts
index b0ac25b..a6819db 100644
--- a/src/models/EventInfo.ts
+++ b/src/models/EventInfo.ts
@@ -22,7 +22,7 @@ export default class EventInfo {
this.end = end;
}
- static fromJSON({days, start, end}: EventInfoSerializeInfo) {
+ static fromJSON({ days, start, end }: EventInfoSerializeInfo) {
return new EventInfo(days, start, end);
}
@@ -49,9 +49,9 @@ export default class EventInfo {
}
get info() {
- if(this.days === "") {
+ if (this.days === "") {
return `WEB`;
- }else if(this.start === -1 || this.end === -1) {
+ } else if (this.start === -1 || this.end === -1) {
return `${this.days}`;
} else {
return `${this.days} ${EventInfo.timeToStr(this.start)}-${EventInfo.timeToStr(this.end)}`;
diff --git a/src/models/PeerTeacher.ts b/src/models/PeerTeacher.ts
index 5d955fd..a93e7de 100644
--- a/src/models/PeerTeacher.ts
+++ b/src/models/PeerTeacher.ts
@@ -20,7 +20,7 @@ export default class PeerTeacher {
labs: Set<number>;
constructor(id: number | string, firstname: string, lastname: string) {
- if(typeof id === "string") {
+ if (typeof id === "string") {
id = parseInt(id, 10);
}
@@ -31,7 +31,7 @@ export default class PeerTeacher {
this.labs = new Set();
}
- static fromJSON({id, firstname, lastname, events, labs}: PeerTeacherSerializeInfo) {
+ static fromJSON({ id, firstname, lastname, events, labs }: PeerTeacherSerializeInfo) {
const pt = new PeerTeacher(id, firstname, lastname);
pt.events = events.map(e => EventInfo.fromJSON(e));
pt.labs = new Set(labs);