let newData = [{name:'姓名01',year:"2020-12-01",day:1},{name:'姓名02',year:"2020-12-01",day:10},{name:'姓名03',year:"2021-11-01",day:10}]
newData.forEach(function(item){
item.sort(function(a,b){return b.year-a.year}) // 按照日期 升序
})
newData.forEach(function(item){
item.sort(function(a,b){ // 先按照日期 再按照天数 排序
if(a.year> b.year){
return 1;
}else if(a.year< b.year){
return -1;
}else{
if(a.day< b.day){
return 1;
}else if(a.day> b.day){
return -1;
}else{
return 0;
}
}
})
})
newData.filter(item=>{//过滤 name == 姓名01 不显示
return String(item.name).toLowerCase() == "姓名01"
})