Cocoa-Puffs commented on code in PR #6588:
URL: https://github.com/apache/fineract/pull/6588#discussion_r4312097778
##########
fineract-core/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarUtils.java:
##########
@@ -90,13 +90,7 @@ public static LocalDate getNextRecurringDate(final String
recurringRule, final L
}
public static Temporal adjustDate(final Temporal date, final Temporal
seedDate, final PeriodFrequencyType frequencyType) {
- if (frequencyType.isMonthly() &&
seedDate.get(ChronoField.DAY_OF_MONTH) > 28 &&
date.get(ChronoField.DAY_OF_MONTH) >= 28) {
- int noOfDaysInCurrentMonth = YearMonth.from(date).lengthOfMonth();
- int seedDay = seedDate.get(ChronoField.DAY_OF_MONTH);
- int adjustedDay = Math.min(noOfDaysInCurrentMonth, seedDay);
- return date.with(ChronoField.DAY_OF_MONTH, adjustedDay);
- }
- return date;
+ return MonthlyDueDateResolver.adjustDate(date, seedDate,
frequencyType, MonthEndDueDateStrategy.LAST_DAY_OF_MONTH);
Review Comment:
added the comment explaining why `LAST_DAY_OF_MONTH` is hard-coded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]