default array:
let defData = [
{
time: "09:00:00"
},
{
time: "09:01:20"
},
{
time: "09:08:00"
},
{
time: "09:10:00"
},
{
time: "09:11:35"
},
{
time: "09:15:07"
},
{
time: "09:18:00"
},
{
time: "13:00:01"
},
{
time: "13:00:01"
},
{
time: "13:00:05"
},
{
time: "13:01:32"
},
{
time: "13:02:01"
},
{
time: "13:05:01"
}
];
requirement description:
my requirement is to re-divide the array in time to form a new 2-dimensional array, each member attribute contains 10 minutes of data, such a structure:
let data = [
[
{time: "09:00:00"},
// ...
{time: "09:10:00"}
],
[
{time: "09:11:00"},
// ...
{time: "09:20:00"}
]
];
I wrote a function to compare the time, but as a result, the time jump span is too large, but the time is out of breath. Ask the big god for help to give a small demo, online urgent wait! Please, this question has been stuck for almost a day.