I am trying to calculate the number of days between 2 localDates
I am taking inspiration from this answer: https://stackoverflow.com/a/325964 to this question Determine Whether Two Date Ranges Overlap
The trouble is, this question uses dateTime which I believe is outdated, hence the reason for using localDate.
Does anyone know of a similar way to implement the algorithm in the above answer using localDate instead.
The minus method doesn't allow subtraction of another localDate.
I have tried using
ChoronoUnit.DAYS.between(LD1, LD2.plusDays(1)) //include the final day in the count
but there are occasions when this produces a negative number so the algorithm breaks because it chooses the smallest number as the number of days overlap