src/main/java/de/uapcore/lightpit/entities/Issue.java

changeset 144
7e06b75cf1b9
parent 134
f47e82cd6077
--- a/src/main/java/de/uapcore/lightpit/entities/Issue.java	Fri Oct 23 11:44:02 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/entities/Issue.java	Fri Oct 23 12:26:08 2020 +0200
@@ -171,6 +171,15 @@
         this.eta = eta;
     }
 
+    /**
+     * An issue is overdue, if it is not done and the ETA is before the current time.
+     * @return true if this issue is overdue, false otherwise
+     */
+    public boolean isOverdue() {
+        return eta != null && status.getPhase() != IssueStatus.PHASE_DONE
+                && eta.before(new Date(System.currentTimeMillis()));
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;

mercurial