Developing a timesheet selection page where the selection should be pre-populated with list of end of week dates for last three months. Need an process with O(n) using Java 8 time API.
My current solution checks for if current date is Sunday, if not find out the end of this week and then iterate back for three months. Looking for an optimized solution.
In JDK 9 there is a new method,
datesUntil
.