List of recently created/modified pages (timestamp issues)

This should work:

#+BEGIN_QUERY
{:title [:h2 "My 24h changes"]
:query [:find (pull ?b [* {:block/_parent ...}])
:in $ ?end
:where
[?b :block/updated-at ?v]
[(- ?end 86400000 ) ?period]
[(>= ?v ?period)]
[(< ?v ?end)]
]
:inputs [:end-of-today-ms]
}
#+END_QUERY

See logseq/query_react.cljs , which pointed to three additional helpers:

You have to choose one of these three inputs; 86400000 is 24 hours in milliseconds (60 x 60 x 24 x 1000), a week would be 604800000 milliseconds.

  • :right-now-ms will give you a 24 hours period from this moment, not very useful, imho
  • :start-of-today-ms which you can use for yesterday’s changes
  • :end-of-today-ms, which would be more useful for today’s changes
2 Likes