The firstDay.until(date) will give back the period which is divided by years months and days , therefore the getDays() will be never greater than |30|.
Solution: to use the firstDay.until(date,ChronoUnit.DAYS) which correctly calculated the days between the two LocalDate
The
firstDay.until(date)
will give back the period which is divided by years months and days , therefore thegetDays()
will be never greater than |30|.Solution: to use the
firstDay.until(date,ChronoUnit.DAYS)
which correctly calculated the days between the twoLocalDate