Browse Source

Fixed age extract issues.

master
Christian P. MOMON 2 years ago
parent
commit
bc3f4fc26f
  1. 35
      src/org/april/agirstatool/core/Issue.java
  2. 13
      src/org/april/agirstatool/core/Issues.java

35
src/org/april/agirstatool/core/Issue.java

@ -144,6 +144,41 @@ public class Issue
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)
{
this.closedOn = closedOn;

13
src/org/april/agirstatool/core/Issues.java

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

Loading…
Cancel
Save