Fri, 23 Oct 2020 12:26:08 +0200
highlight passed ETA - fixes #23
--- 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;
--- a/src/main/webapp/WEB-INF/jspf/issue-list.jspf Fri Oct 23 11:44:02 2020 +0200 +++ b/src/main/webapp/WEB-INF/jspf/issue-list.jspf Fri Oct 23 12:26:08 2020 +0200 @@ -1,7 +1,6 @@ <%-- issues: List<Issue> --%> - <table class="fullwidth datatable medskip"> <colgroup> <col width="auto" /> @@ -31,7 +30,9 @@ </div> </td> <td> - <fmt:formatDate value="${issue.eta}" /> + <span class="<c:if test="${issue.overdue}">eta-overdue</c:if> "> + <fmt:formatDate value="${issue.eta}" /> + </span> </td> </tr> </c:forEach>