fix: repeated tasks

1. Don't show repeat kinds selection (.+, ++, +)
2. Fixed wrong time (no zero padding)
3. Fixed `.+` and `++` behaviors
This commit is contained in:
Tienson Qin
2020-11-05 16:52:07 +08:00
parent 230bd219a6
commit 0a5b88467b
5 changed files with 77 additions and 62 deletions

View File

@@ -811,13 +811,19 @@
(defn update-timestamps-content!
[{:block/keys [repeated? scheduled-ast deadline-ast marker]} content]
(if repeated?
(some->> (filter repeated/repeated? [scheduled-ast deadline-ast])
(map (fn [ts]
[(repeated/timestamp->text ts)
(repeated/next-timestamp-text ts)]))
(reduce (fn [content [old new]]
(string/replace content old new))
content))
(let [content (some->> (filter repeated/repeated? [scheduled-ast deadline-ast])
(map (fn [ts]
[(repeated/timestamp->text ts)
(repeated/next-timestamp-text ts)]))
(reduce (fn [content [old new]]
(string/replace content old new))
content))]
(when content
(str (string/trimr content)
"\n"
(util/format "- %s -> DONE [%s]"
marker
(date/get-local-date-time-string)))))
content))
(defn- with-marker-time