refactor: remove both :block/scheduled-ast and :block/deadline-ast

This commit is contained in:
Tienson Qin
2021-03-23 14:55:01 +08:00
parent 9a08353037
commit 4dddaa66ab
5 changed files with 63 additions and 31 deletions

View File

@@ -861,9 +861,11 @@
:current-page (state/get-current-page)})))
(defn update-timestamps-content!
[{:block/keys [repeated? scheduled-ast deadline-ast marker]} content]
[{:block/keys [repeated? marker] :as block} content]
(if repeated?
(let [content (some->> (filter repeated/repeated? [scheduled-ast deadline-ast])
(let [scheduled-ast (block-handler/get-scheduled-ast block)
deadline-ast (block-handler/get-deadline-ast block)
content (some->> (filter repeated/repeated? [scheduled-ast deadline-ast])
(map (fn [ts]
[(repeated/timestamp->text ts)
(repeated/next-timestamp-text ts)]))