Is there a usablility to get all dates between two dates in the new java.time API?
Let\'s say I have this part of code:
In my time library Time4J, I have written an optimized spliterator to construct a stream of calendar dates with good parallelization characteristics. Adapted to your use-case:
LocalDate start = ...;
LocalDate end = ...;
Stream stream =
DateInterval.between(start, end) // closed interval, else use .withOpenEnd()
.streamDaily()
.map(PlainDate::toTemporalAccessor);
This short approach can be an interesting start point if you are also interested in related features like clock intervals per calendar date (partitioned streams) or other interval features and want to avoid awkward hand-written code, see also the API of DateInterval.