mirror of https://github.com/logseq/logseq
feat(clock): add markdown support
parent
be3dd3aa10
commit
80bfc4105e
|
@ -1846,19 +1846,6 @@
|
|||
|
||||
(when (and (= (:block/marker block) "DONE")
|
||||
(state/enable-timetracking?))
|
||||
(let [start-time (or
|
||||
(get properties :now)
|
||||
(get properties :doing)
|
||||
(get properties :in-progress)
|
||||
(get properties :later)
|
||||
(get properties :todo))
|
||||
finish-time (get properties :done)]
|
||||
(when (and start-time finish-time (> finish-time start-time))
|
||||
[:div.text-sm.time-spent.ml-1 {:title (str (date/int->local-time start-time) " ~ " (date/int->local-time finish-time))
|
||||
:style {:padding-top 3}}
|
||||
[:a.opacity-30.hover:opacity-100
|
||||
(utils/timeConversion (- finish-time start-time))]]))
|
||||
|
||||
(let [summary (clock/clock-summary format content)]
|
||||
(when summary
|
||||
[:div.text-sm.time-spent.ml-1 {:title "org-clock-summary"
|
||||
|
|
|
@ -782,23 +782,21 @@
|
|||
(if (state/enable-timetracking?)
|
||||
(let [new-marker (string/lower-case new-marker)
|
||||
old-marker (when old-marker (string/lower-case old-marker))]
|
||||
(if (= :org format)
|
||||
(when old-marker
|
||||
(cond
|
||||
(and (= old-marker "todo") (= new-marker "doing"))
|
||||
(clock/clock-in format content)
|
||||
(and (= old-marker "doing") (= new-marker "todo"))
|
||||
(clock/clock-out format content)
|
||||
(and (= old-marker "later") (= new-marker "now"))
|
||||
(clock/clock-in format content)
|
||||
(and (= old-marker "now") (= new-marker "later"))
|
||||
(clock/clock-out format content)
|
||||
(and (contains? #{"now" "doing"} old-marker)
|
||||
(= new-marker "done"))
|
||||
(clock/clock-out format content)
|
||||
:else
|
||||
content))
|
||||
(property/insert-property format content new-marker (util/time-ms))))
|
||||
(when old-marker
|
||||
(cond
|
||||
(and (= old-marker "todo") (= new-marker "doing"))
|
||||
(clock/clock-in format content)
|
||||
(and (= old-marker "doing") (= new-marker "todo"))
|
||||
(clock/clock-out format content)
|
||||
(and (= old-marker "later") (= new-marker "now"))
|
||||
(clock/clock-in format content)
|
||||
(and (= old-marker "now") (= new-marker "later"))
|
||||
(clock/clock-out format content)
|
||||
(and (contains? #{"now" "doing"} old-marker)
|
||||
(= new-marker "done"))
|
||||
(clock/clock-out format content)
|
||||
:else
|
||||
content)))
|
||||
content))
|
||||
|
||||
(defn check
|
||||
|
|
Loading…
Reference in New Issue