How to split array based on 1 or more days difference between date of array element?
Consider following array:
[
{"Name":"A", "Date":"01/01/2021"},
{"Name":"B", "Date":"02/01/2021"},
{"Name":"C", "Date":"05/01/2021"},
{"Name":"D", "Date":"06/01/2021"},
{"Name":"E", "Date":"09/01/2021"}
]
Now split this array to 3 arrays. as following
[{"Name":"A", "Date":"01/01/2021"}, {"Name":"B", "Date":"02/01/2021"}][{"Name":"C", "Date":"05/01/2021"}, {"Name":"D", "Date":"06/01/2021"}][{"Name":"E", "Date":"09/01/2021"}]
The array should split with object which have continuous dates.