|
|
|
@ -43,16 +43,17 @@ function getlist(data,isdir) { |
|
|
|
|
let list = data.filter(item => { |
|
|
|
|
return isdir ? item.is_dir : fileFilter?contain.test(item.name):item.is_dir==0; |
|
|
|
|
}) |
|
|
|
|
list = list.sort((a,b)=>{ |
|
|
|
|
let oDate1 = new Date(a.modified); |
|
|
|
|
let oDate2 = new Date(b.modified); |
|
|
|
|
if(a.modified!=b.modified){ |
|
|
|
|
return oDate2.getTime() > oDate1.getTime() |
|
|
|
|
}else{ |
|
|
|
|
return a.name.replace(/[^\d]/g, " ") - b.name.replace(/[^\d]/g, " "); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
log(list); |
|
|
|
|
try{ |
|
|
|
|
list = list.sort((a,b)=>{ |
|
|
|
|
let oDate1 = new Date(a.modified); |
|
|
|
|
let oDate2 = new Date(b.modified); |
|
|
|
|
if(a.modified!=b.modified){ |
|
|
|
|
return oDate2.getTime() < oDate1.getTime() |
|
|
|
|
}else{ |
|
|
|
|
return a.name.replace(/[^\d]/g, " ") - b.name.replace(/[^\d]/g, " "); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}catch(e){} |
|
|
|
|
return list; |
|
|
|
|
}catch(e){ |
|
|
|
|
return []; |
|
|
|
|