默认数组:
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"
}
];
需求描述:
我的需求是按时间重新分割数组,组成一个新的2维数组,每个成员属性包含10分钟数据,这样的结构:
let data = [
[
{time: "09:00:00"},
// ...省略中间
{time: "09:10:00"}
],
[
{time: "09:11:00"},
// ...省略中间
{time: "09:20:00"}
]
];
我自己写了个函数做时间对比的方式,但结果时间跳跃跨度太大但时候就抽风了,求大神帮忙给个小demo,在线急等···!拜托啦,这个问题卡了我快1天了。
是这个意思?等等我修改一下。