mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: scheduled and deadline
This commit is contained in:
@@ -1269,34 +1269,36 @@ independent of format as format specific heading characters are stripped"
|
||||
[journal-title]
|
||||
(when-let [date (date/journal-title->int journal-title)]
|
||||
(let [future-days (state/get-scheduled-future-days)
|
||||
date-format "yyyyMMdd"
|
||||
current-day (tf/parse (tf/formatter date-format) (str date))
|
||||
future-day (->> (t/plus current-day (t/days future-days))
|
||||
(tf/unparse date-format))]
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(->> (react/q repo [:custom :scheduled-deadline journal-title]
|
||||
{:use-cache? false}
|
||||
'[:find [(pull ?block ?block-attrs) ...]
|
||||
:in $ ?day ?future ?block-attrs
|
||||
:where
|
||||
(or
|
||||
[?block :block/scheduled ?d]
|
||||
[?block :block/deadline ?d])
|
||||
[(get-else $ ?block :block/repeated? false) ?repeated]
|
||||
[(get-else $ ?block :block/marker "NIL") ?marker]
|
||||
[(not= ?marker "DONE")]
|
||||
[(not= ?marker "CANCELED")]
|
||||
[(not= ?marker "CANCELLED")]
|
||||
[(<= ?d ?future)]
|
||||
(or-join [?repeated ?d ?day]
|
||||
[(true? ?repeated)]
|
||||
[(>= ?d ?day)])]
|
||||
date
|
||||
future-day
|
||||
block-attrs)
|
||||
react
|
||||
(sort-by-left-recursive)
|
||||
db-utils/group-by-page)))))
|
||||
date-format (tf/formatter "yyyyMMdd")
|
||||
current-day (tf/parse date-format (str date))
|
||||
future-day (some->> (t/plus current-day (t/days future-days))
|
||||
(tf/unparse date-format)
|
||||
(parse-long))]
|
||||
(when future-day
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(->> (react/q repo [:custom :scheduled-deadline journal-title]
|
||||
{:use-cache? false}
|
||||
'[:find [(pull ?block ?block-attrs) ...]
|
||||
:in $ ?day ?future ?block-attrs
|
||||
:where
|
||||
(or
|
||||
[?block :block/scheduled ?d]
|
||||
[?block :block/deadline ?d])
|
||||
[(get-else $ ?block :block/repeated? false) ?repeated]
|
||||
[(get-else $ ?block :block/marker "NIL") ?marker]
|
||||
[(not= ?marker "DONE")]
|
||||
[(not= ?marker "CANCELED")]
|
||||
[(not= ?marker "CANCELLED")]
|
||||
[(<= ?d ?future)]
|
||||
(or-join [?repeated ?d ?day]
|
||||
[(true? ?repeated)]
|
||||
[(>= ?d ?day)])]
|
||||
date
|
||||
future-day
|
||||
block-attrs)
|
||||
react
|
||||
(sort-by-left-recursive)
|
||||
db-utils/group-by-page))))))
|
||||
|
||||
(defn- pattern [name]
|
||||
(re-pattern (str "(?i)(^|[^\\[#0-9a-zA-Z]|((^|[^\\[])\\[))"
|
||||
|
||||
Reference in New Issue
Block a user