今日任务动态
const raw = dv.current()["journal-date"];
const dateStr = typeof raw?.toFormat === "function" ? raw.toFormat("yyyy-MM-dd") : String(raw);
const start = dv.date(dateStr);
const end = start.plus({ days: 1 });
dv.table(["任务", "待办项"],
dv.pages('"CYG-Works/需求任务-Tasks"')
.where(p => {
if (p.file.cday >= start && p.file.cday < end) return true;
return p.file.lists.some(item => item.text.includes(dateStr));
})
.sort(p => p.file.mday, "desc")
.map(p => [
p.file.link,
p.file.tasks.where(t => t.text).map(t => t.text).join(" | ")
])
);工作日志
const raw = dv.current()["journal-date"];
const dateStr = typeof raw?.toFormat === "function" ? raw.toFormat("yyyy-MM-dd") : String(raw);
const rows = [];
const pages = dv.pages('"CYG-Works/需求任务-Tasks"').sort(p => p.file.name, "desc");
for (const page of pages) {
const entries = page.file.lists.where(item => !item.task && item.text.includes(dateStr));
let first = true;
for (const entry of entries) {
const children = entry.children || [];
const time = entry.text.replace(/<!--uuid:.*?-->/g, "").trim();
const content = children.length > 0 ? children.map(c => c.text).join(" | ") : "";
rows.push([first ? page.file.link : "", time, content]);
first = false;
}
}
dv.table(["任务", "时间", "内容"], rows);备注
github token : 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