I think it would be useful if we could use cljs formatters in Datalog queries.
It is already in use by the LogSeq frontend:
but it is not clear how to use these utility functions in a Datalog
There are plenty articles about transforming the UNIX epoch timestamps into a more malleable form for querying.
- How to group todos by week of year?
- List of recently created/modified pages (timestamp issues)
- How to compare with unix time (timestamps) and date time?
- Query list of all pages I created or updated during last 7 days
- Query for recently accessed/modified/created pages, limiting the query to top-N
The basic strategy seems to convert one’s own DateTime objects manually into UNIX epoch, and run arithmetic operations against those.
Using the cljs formatters would also allow to create string representations, with which we can work differently.
Additionally there is some confusion about Clojure and ClojureScript, and which is offered or used where:
- Using Clojure and Java in an advanced query?
- Which Clojure functions can I use in Logseq Advanced Queries?
Apart from this
mentions that not all Clojure / ClojureScript interfaces are available. Is there a specific reason why that is the case?