Skip to content

Commit

Permalink
#3237: change supported period to 1 year
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerd Gühne (Marfir) committed Apr 6, 2023
1 parent 1464fb7 commit 00d74e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import name.abuchen.portfolio.snapshot.ClientSnapshot;
import name.abuchen.portfolio.snapshot.GroupByTaxonomy;
import name.abuchen.portfolio.snapshot.ReportingPeriod;
import name.abuchen.portfolio.snapshot.ReportingPeriod.SinceX;
import name.abuchen.portfolio.snapshot.ReportingPeriod.LastXYears;
import name.abuchen.portfolio.snapshot.SecurityPosition;
import name.abuchen.portfolio.snapshot.filter.ClientFilter;
import name.abuchen.portfolio.snapshot.filter.ReadOnlyAccount;
Expand Down Expand Up @@ -751,7 +751,7 @@ private void addDividendColumns(List<ReportingPeriod> options)
// dividend yield on costs
column = new Column("yocdiv", Messages.ColumnDividendYieldOnCost, SWT.RIGHT, 80); //$NON-NLS-1$
column.setOptions(new ReportingPeriodColumnOptions(Messages.ColumnDividendYieldOnCost + " {0}", // $NON-NLS-1$ //$NON-NLS-1$
List.of(new SinceX(LocalDate.now().minusDays(365)))));
List.of(new LastXYears(1))));
column.setGroupLabel(Messages.GroupLabelDividends);
column.setDescription(Messages.ColumnDividendYieldOnCost_Description);
column.setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ public String getCode()
return buf.toString();
}

public static class LastXYears extends LastX
{

public LastXYears(int years)
{
super(years, 0);
}
}

public static class LastX extends ReportingPeriod
{
private final int years;
Expand Down

0 comments on commit 00d74e6

Please sign in to comment.