Just to give you an idea (since you tagged JAVA) , in JAVA this can be accomplished using Date API’s. For testing i was just checking for 5 weeks , you could go all the way to 90 weeks. Please note that this provides an idea , can it be optimized , possibly yes
public static void main(String[] args) {
try {
LocalDateTime localDateTime = LocalDate.now().atStartOfDay();
DayOfWeek dotw = localDateTime.getDayOfWeek();
String dayOfTheWeek = dotw.name();
for (int daysOfTheWeek = 1; daysOfTheWeek < 7; daysOfTheWeek++) {
if (dayOfTheWeek.equals(DayOfWeek.FRIDAY.name())) {
break;
} else {
localDateTime = LocalDate.now().atStartOfDay().minusDays(daysOfTheWeek);
dotw = localDateTime.getDayOfWeek();
dayOfTheWeek = dotw.name();
}
}
ArrayList<LocalDate> localDates = new ArrayList<LocalDate>();
for (int weekCount = 0; weekCount < 5; weekCount++) {
localDates.add(localDateTime.minusWeeks(weekCount).toLocalDate());
}
System.out.println(localDates);
} catch (final Throwable t) {
t.printStackTrace();
}
}