dataview 筛选 本周完成任务

使用calendar插件,想要设置一个周记的模板。
设置calendar设置中设置周记的名称为 gggg-[W]ww
如果通过上述gggg-[W]ww利用dateview筛选出本周完成的任务
现阶段我使用的代码如下:

---
author: 周周周
created:  <% tp.file.creation_date("YYYY-MM-DD HH:mm") %>
alias: 
    - <% tp.file.title %>
tags:
    - 
source: 
---


```dataview
task from -"00.个人生活/checklist" and -"模板" and -"收集箱" and -"01.工作/归档" and -"01.工作/工作资料"
where completed and 完成 >= date("<% tp.file.title %>") - dur(1 week) and contains(text, "#邱邱邱")
sort file.mtime desc
```

其中date("<% tp.file.title %>") 利用templater 自动替换成 日期的话例如2022-03-31上述的dateview的代码是可以达到我的目的。

但是显然在本模板中 <% tp.file.title %>将替换成 前述的 gggg-[W]ww例如2022-W13则dataview的代码就无法 工作

有没有超能者可以帮忙修改一下上述代码

1 个赞

查了一下 templater的帮助文档
通过将date("<% tp.file.title %>")替换为<% tp.date.weekday("YYYY-MM-DD",0) %>算是曲线且解决了上述问题。
当时还是想吧这个参数和note title结合起来,使用templater是直接和创建文件的日期相关的,而note title是与确定的日期相关的。