求一句“往年今日”query命令,跪谢!

小白不懂命令,想要实现“往年今日”的功能,在当天Journal中显示往年今日的Journals页面,求大佬帮忙,谢啦!

这个可以显示去年今日

{{query (between -1y -1y )}}

来源:This time last year query in config.edn? - Questions & Help - Logseq

谢谢,怎么可以显示每一年今日呢?

想了一个笨办法:
{{query (or (between -1y -1y ) (between -2y -2y ) (between -3y -3y ) ……)}}
大神见笑,哈哈哈哈

不懂高级命令,Dynamic Variable也不支持查找循环的时间 :smiling_face_with_tear:

Dynamic Variables
Parse reoccurring dates · Issue #349 · wanasit/chrono

https://logseq.pro/#/page/queries

检索当日

#+BEGIN_QUERY
{:title [:b "🌺那年今日"]
 :query [:find (pull ?j [*])
         :in $ ?today
         :where 
         [?j :block/journal-day ?jd]
         [(- ?today ?jd) ?days]
         [(mod ?days 10000) ?r]
         [(= 0 ?r)]
         [(> ?days 0)]
         ]
 :inputs [:today]
 }
#+END_QUERY

放侧边栏动态刷新

#+BEGIN_QUERY
{:title [:b "🌺那年今日(动态)"]
 :query [:find (pull ?j [*])
         :in $ ?cn
         :where 
         [?c :block/name ?cn]
         [?c :block/journal-day ?cd]
         [?j :block/journal-day ?jd]
         [(- ?cd ?jd) ?days]
         [(mod ?days 10000) ?r]
         [(= 0 ?r)]
         [(> ?days 0)]
         ]
 :inputs [:current-page]
 }
#+END_QUERY

:hatching_chick:祝使用愉快

虽然看不懂,但是很好用,跪谢大神! :pray:

大神,求指点,我对您的代码做了一点改动,想显示往年今日那个page中具有“tag1"标签的block,但检索不出任何东西,搞了很久,不知道哪里出了问题

#+BEGIN_QUERY
{:title [:b "🌺那年今日"]
 :query [:find (pull ?b [*])
         :in $ ?today ?tag ;;加了标签?tag
         :where 
         [?t :block/name ?tag] ;;加了标签
         [?b :block/tags ?t] ;;加了标签
         [?b :block/ref-pages ?j] ;;加了标签
         [?j :block/journal-day ?jd]
         [(- ?today ?jd) ?days]
         [(mod ?days 10000) ?r]
         [(= 0 ?r)]
         [(> ?days 0)]
         ]
 :inputs [:today "tag1"] ::加了标签tag1
 }
#+END_QUERY

给实例,具体想搜出来什么东西?

感谢回复!

这是一年前的日志:

这是那年今日的结果:

我希望得到当日[[文献阅读]]这一block下的所有subblock,或者当日page中所有含有 #文献 标签的block,这是我的尝试:

#+BEGIN_QUERY
{:title [:b "🌺那年今日"]
 :query [:find (pull ?b [*])
         :in $ ?today ?tag
         :where 
         [?t :block/name ?tag]
         [?b :block/tags ?t]
         [?b :block/ref-pages ?p]
         [?p :block/journal-day ?jd]
         [(- ?today ?jd) ?days]
         [(mod ?days 10000) ?r]
         [(= 0 ?r)]
         [(> ?days 0)]
         ]
 :inputs [:today "文献"]
 }
#+END_QUERY

结果是0
image

求大神指点

已更新到 https://logseq.pro/#/page/queries

#+BEGIN_QUERY
{:title [:b "🌺那年今日的文献"]
 :query [:find (pull ?b [*])
         :in $ ?today
         :where 
         ;; 检索出对应 journal
         [?j :block/journal-day ?jd]
         [(- ?today ?jd) ?days]
         [(mod ?days 10000) ?r]
         [(= 0 ?r)]
         [(> ?days 0)]
         ;; 检索 journal 下符合条件的 block
         [?b :block/page ?j]
         (or [?b :block/path-refs [:block/name "文献"]]
             [?b :block/path-refs [:block/name "文献阅读"]])
         ]
 :inputs [:today]
 }
#+END_QUERY

完美地解决了我的问题!多谢大神!