fix: scheduled && deadline not working

pull/1697/head
Tienson Qin 2021-04-28 15:36:45 +08:00
parent 4c83040ec1
commit 72c2deb5f2
1 changed files with 1 additions and 5 deletions

View File

@ -748,16 +748,12 @@
(defn set-block-timestamp!
[block-id key value]
(let [key (string/lower-case key)
scheduled? (= key "scheduled")
deadline? (= key "deadline")
block-id (if (string? block-id) (uuid block-id) block-id)
key (string/lower-case (str key))
value (str value)]
(when-let [block (db/pull [:block/uuid block-id])]
(let [{:block/keys [content scheduled deadline format]} block
content (or (when-let [edit-content (state/get-edit-content)]
(block/with-levels edit-content format block))
content)
content (or (state/get-edit-content) content)
new-line (str (string/upper-case key) ": " value)
new-content (let [lines (string/split-lines content)
new-lines (map (fn [line]