Skip to content

Commit

Permalink
change impl of duration function - convert a duration string to minut…
Browse files Browse the repository at this point in the history
…es in long
  • Loading branch information
humorless committed Aug 17, 2024
1 parent 5735a33 commit b714f1a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/co/gaiwan/compass/model/session.clj
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
(defn duration
"Input is like `PT45M`"
[duration-str]
(let [matcher (re-matcher #"\d+" duration-str)
minutes (re-find matcher)]
(parse-long minutes)))
(let [d (time/duration duration-str)]
(.toMinutes d)))

(defmulti apply-filter (fn [_ _ k _] k))

Expand Down

0 comments on commit b714f1a

Please sign in to comment.