I have a list of DateTime
values and I want to split the whole list into sublists for each week.
The dates might span across multiple years(the user selects the start and end date), so a solution that splits them up per calendar week number would end up in conflicts.
Is there a way to traverse the list and then store each week's DateTime
values in a new 2d list?
The values available are from Monday to Friday and first and last week might have fewer values.
The only relevant question I found is How to group dates by weeks but it is not suitable for my case.