summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java
index 6064aa49..6a6a99c3 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java
@@ -51,6 +51,7 @@ import org.openslx.dozmod.thrift.ThriftActions.DeleteLectureCallback;
import org.openslx.dozmod.thrift.cache.LectureCache;
import org.openslx.dozmod.thrift.cache.UserCache;
import org.openslx.util.QuickTimer;
+import org.openslx.util.Util;
import org.openslx.util.QuickTimer.Task;
/**
@@ -113,7 +114,8 @@ public class LectureListWindow extends LectureListWindowLayout {
// filter for active lectures
private final RowFilter<ListModel<LectureSummary>, Integer> filterActive = new RowFilter<ListModel<LectureSummary>, Integer>() {
public boolean include(Entry<? extends ListModel<LectureSummary>, ? extends Integer> entry) {
- return tblLectures.getModelRow(entry.getIdentifier()).isEnabled;
+ LectureSummary lecture = tblLectures.getModelRow(entry.getIdentifier());
+ return lecture.isEnabled && lecture.endTime > Util.unixTime();
}
};
// filter for editable lectures
@@ -126,11 +128,7 @@ public class LectureListWindow extends LectureListWindowLayout {
private final RowFilter<ListModel<LectureSummary>, Integer> filterExpiring = new RowFilter<ListModel<LectureSummary>, Integer>() {
public boolean include(Entry<? extends ListModel<LectureSummary>, ? extends Integer> entry) {
LectureSummary selLect = tblLectures.getModelRow(entry.getIdentifier());
- long end = selLect.getEndTime() * 1000l;
- Calendar cal = Calendar.getInstance();
- cal.setTime(new Date());
- cal.add(Calendar.DATE, 7);
- return cal.getTimeInMillis() > end ? true : false;
+ return Math.abs(selLect.endTime - Util.unixTime()) < 86400 * 7;
}
};