You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got the below code to find the note with the most recent modified-date within each folder. This has been working really well but as my vault is growing this code is now (with 3k+ notes) taking about half a minute to load. This makes it difficult to use in practice.
Would anyone here have any idea on how I could optimise this to load more quickly?
```dataviewjs
function checkDate(item) {
if (moment(new Date(item.lastDate)).isAfter(moment().subtract(2, 'weeks'))){
return true
}
return false
}
// Get last touch on customer
let customers = dv.pages('"🏙️ Customers" and #case')
for (let customer of customers){
customer.lastDate = customer.file.mday
for (let inlink of customer.file.inlinks){
if(dv.page(inlink).file.tags.indexOf("#meeting") > -1 && dv.page(inlink).file.folder == customer.file.folder){
if (customer.lastDate < dv.page(inlink).file.mday){
customer.lastDate = dv.page(inlink).file.mday
}
}
}
}
dv.table(["Logo","Name", "Products","ARR","Invoices","AE", "Last activity"], customers
.filter(t => checkDate(t))
.sort(k => k.lastDate, "desc")
.map(b => ["![](" + b.logo + ")","[["+b.file.name+"]]", b.products, b.ARR, b.Invoices ,b.ae, b.lastDate]))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've got the below code to find the note with the most recent modified-date within each folder. This has been working really well but as my vault is growing this code is now (with 3k+ notes) taking about half a minute to load. This makes it difficult to use in practice.
Would anyone here have any idea on how I could optimise this to load more quickly?
Beta Was this translation helpful? Give feedback.
All reactions