This commit is contained in:
Filip Izydorczyk 2020-08-18 15:41:03 +02:00
parent fadf2f309c
commit 6ba49cecad
2 changed files with 10 additions and 2 deletions

View File

@ -89,4 +89,13 @@ public class Groups {
public void setCourseId(Course courseId) {
this.courseId = courseId;
}
public String getTimeString() {
int minutes = this.getTime() % 60;
String minutesString = Integer.toString(minutes);
if (minutes < 10) {
minutesString = "0" + minutesString;
}
return String.format("%o.%s", this.getTime() / 60, minutesString);
}
}

View File

@ -1,6 +1,5 @@
package com.plannaplan.controllers;
import java.security.acl.Group;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Hashtable;
@ -32,7 +31,7 @@ public class GroupController {
Dictionary<String, Object> group = new Hashtable<>();
group.put("id", g.getId());
group.put("day", g.getDay().label + 1);
group.put("time", String.format("%o.%o", g.getTime() / 60, g.getTime() % 60));
group.put("time", g.getTimeString());
group.put("lecturer", g.getLecturer().toString());
group.put("room", g.getRoom());
group.put("capacity", g.getCapacity());