Skip to content

Commit

Permalink
fix: change dividend date search criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
songyi00 committed Feb 26, 2024
1 parent fad84a5 commit 5c556be
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private List<Dividend> getLastYearDividends(Stock stock) {

return dividendRepository.findAllByStockId(stock.getId())
.stream()
.filter(dividend -> InstantProvider.toLocalDate(dividend.getPaymentDate()).getYear() == lastYear)
.filter(dividend -> InstantProvider.toLocalDate(dividend.getExDividendDate()).getYear() == lastYear)
.collect(Collectors.toList());
}

Expand All @@ -74,7 +74,7 @@ private List<Dividend> getThisYearDividends(Stock stock) {

return dividendRepository.findAllByStockId(stock.getId())
.stream()
.filter(dividend -> InstantProvider.toLocalDate(dividend.getPaymentDate()).getYear() == thisYear)
.filter(dividend -> InstantProvider.toLocalDate(dividend.getExDividendDate()).getYear() == thisYear)
.collect(Collectors.toList());
}

Expand Down

0 comments on commit 5c556be

Please sign in to comment.