Fixed age extract issues.

This commit is contained in:
Christian P. MOMON 2020-01-29 14:10:50 +01:00
parent de605e2a55
commit bc3f4fc26f
2 changed files with 36 additions and 12 deletions

View File

@ -144,6 +144,41 @@ public class Issue
return this.projectId; return this.projectId;
} }
/**
* Checks if is active at.
*
* @param date
* the date
* @return true, if is active at
*/
public boolean isActiveAt(final LocalDate date)
{
boolean result;
LocalDate createdDate = this.createdOn.toLocalDate();
LocalDate closedDate;
if (this.closedOn == null)
{
closedDate = null;
}
else
{
closedDate = this.closedOn.toLocalDate();
}
if ((!createdDate.isAfter(date)) && ((closedDate == null) || (date.isBefore(closedDate))))
{
result = true;
}
else
{
result = false;
}
//
return result;
}
public void setClosedOn(final LocalDateTime closedOn) public void setClosedOn(final LocalDateTime closedOn)
{ {
this.closedOn = closedOn; this.closedOn = closedOn;

View File

@ -106,18 +106,7 @@ public class Issues extends ArrayList<Issue>
for (Issue issue : this) for (Issue issue : this)
{ {
LocalDate createdOn = issue.getCreatedOn().toLocalDate(); if (issue.isActiveAt(date))
LocalDate closedOn;
if (issue.getClosedOn() == null)
{
closedOn = null;
}
else
{
closedOn = issue.getClosedOn().toLocalDate();
}
if ((!createdOn.isAfter(date)) && ((issue.getClosedOn() == null) || (!closedOn.isBefore(date))))
{ {
result.add(issue); result.add(issue);
} }