Skip to content

Instantly share code, notes, and snippets.

@addozhang
Last active November 9, 2024 03:51
Show Gist options
  • Save addozhang/3f9a1bcf3606c3e2c81046e604dd6015 to your computer and use it in GitHub Desktop.
Save addozhang/3f9a1bcf3606c3e2c81046e604dd6015 to your computer and use it in GitHub Desktop.
Obsidian log template

[[日志/Daily/<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD")%>|⬅昨天]] | [[日志/Daily/<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD-dddd")%>|明天 ➡️]] | [[日志/Weekly/<%moment(tp.file.title, "YYYY-MM-DD").format("gggg-[W]ww")%>|本周 📅]]

截止到今天的任务

path includes Daily
not done
due on <%moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD")%>
hide due date
hide created date
hide priority
#hide backlink
hide edit button
sort by priority

进行中的任务

path includes Daily
not done
due after <%moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD")%>
#hide due date
hide created date
hide priority
#hide backlink
hide edit button
sort by priority

今天任务

日志

阅读列表

TABLE elink(url, "🔗") as URL from "阅读/碎片/文章"
WHERE date > date(<%moment(tp.file.title).format("YYYY-MM-DD")%>) - dur(1day) and date <= date(<%moment(tp.file.title).format("YYYY-MM-DD")%>) 

<%moment(tp.file.title).startOf('isoWeek').format("MMM-DD")%> ~ <%moment(tp.file.title).endOf('isoWeek').format("MMM-DD")%>

[[<%moment(tp.file.title).subtract(1, 'week').format("gggg-[W]ww")%>|⬅️ 上周]] | [[<%moment(tp.file.title).subtract(-1, 'week').format("gggg-[W]ww")%>|下周 ➡️]]

日期

  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(0,'day').format('YYYY-MM-DD')%>|周一]]
  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(1,'day').format('YYYY-MM-DD')%>|周二]]
  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(2,'day').format('YYYY-MM-DD')%>|周三]]
  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(3,'day').format('YYYY-MM-DD')%>|周四]]
  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(4,'day').format('YYYY-MM-DD')%>|周五]]
  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(5,'day').format('YYYY-MM-DD')%>|周六]]
  • [[日志/Daily/<%moment(tp.file.title).startOf('isoWeek').add(6,'day').format('YYYY-MM-DD')%>|周日]]

本周未完成的任务

path includes Daily
not done
(scheduled on or after <%moment(tp.file.title).startOf('isoWeek').add(0,'day').format("YYYY-MM-DD")%>) OR (due on or after <%moment(tp.file.title).startOf('isoWeek').add(0,'day').format("YYYY-MM-DD")%>)
(scheduled on or before <%moment(tp.file.title).startOf('isoWeek').add(6,'day').format("YYYY-MM-DD")%>) OR (due on or before <%moment(tp.file.title).startOf('isoWeek').add(6,'day').format("YYYY-MM-DD")%>)
hide due date
hide created date
hide priority
hide edit button
#hide backlink
sort by priority

本周已完成的任务

path includes Daily
done
(scheduled on or after <%moment(tp.file.title).startOf('isoWeek').add(0,'day').format("YYYY-MM-DD")%>) OR (due on or after <%moment(tp.file.title).startOf('isoWeek').add(0,'day').format("YYYY-MM-DD")%>)
(scheduled on or before <%moment(tp.file.title).startOf('isoWeek').add(6,'day').format("YYYY-MM-DD")%>) OR (due on or before <%moment(tp.file.title).startOf('isoWeek').add(6,'day').format("YYYY-MM-DD")%>)
hide due date
hide created date
hide priority
hide edit button
#hide backlink
hide done date
sort by priority

阅读列表

LIST from "阅读/碎片/文章"
WHERE date >= date(<%moment(tp.file.title).startOf('isoWeek').add(0,'day').format("YYYY-MM-DD")%>) AND date <= date(<%moment(tp.file.title).startOf('isoWeek').add(6,'day').format("YYYY-MM-DD")%>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment