This time last year query in config.edn?

I am wondering what is the syntax for querying the journal page of this date yet exactly one year ago (eg today is Jun 27, 2022 and the query result is Jun 27, 2021). I found here that the logseq query is {{query (between -1y -1y )}}, which works. But I am wondering what is the equivalence for the query syntax in config.edn?
Thanks!

Anyone got a clue? Appreciate any input!

Okey I think I got the solution

{                                                                                                    
    :title            "This time last year"                                                                        
    :query            [:find (pull ?b [*])                                                              
                       :in $ ?span                                                                      
                       :where                                                                           
                       (between ?b ?span ?span)                                                         
                       ]                                                                                
    :inputs           [:365d-before ]                                                                   
   :collapsed?       false} 

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

Put this in config.edn.

#+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

Put this in siderbar.

#+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:Have fun! (And learn some Chinese in those queries :smiley: )

1 Like

I’m sorry to bother you, but I’m not sure where to put this query. Could you please guide me?

Welcome. This is probably about section :default-queries of file config.edn inside folder logseq of your graph.

I did this, but there was no response on the journal page.

Be careful with the syntax, the queries should be inside an array:

 :default-queries
 {:journals
  [
   {:title

    ...

   }
  ]
 }

Thanks to your suggestion, the problem has been fixed and everything’s running smoothly now. Thanks again!