📋 笔记统计
const now = new Date();
const today = now.toISOString().split('T')[0];
const weekAgo = new Date(now - 7*86400000).toISOString().split('T')[0];
const monthAgo = new Date(now - 30*86400000).toISOString().split('T')[0];
const allPages = dv.pages().array();
let todayCount=0, weekCount=0, monthCount=0;
allPages.forEach(p => {
if (p.file.mtime) {
const d = p.file.mtime.toISODate();
if (d === today) todayCount++;
if (d >= weekAgo) weekCount++;
if (d >= monthAgo) monthCount++;
}
});
dv.paragraph(`📝 今日 **${todayCount}** · 本周 **${weekCount}** · 本月 **${monthCount}** · 总计 **${allPages.length}**`);