From b714f1a02cee44f5aca415f22050220c4c71b297 Mon Sep 17 00:00:00 2001 From: Laurence Chen Date: Sat, 17 Aug 2024 17:09:19 +0800 Subject: [PATCH] change impl of duration function - convert a duration string to minutes in long --- src/co/gaiwan/compass/model/session.clj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/co/gaiwan/compass/model/session.clj b/src/co/gaiwan/compass/model/session.clj index d9ef627..f43a727 100644 --- a/src/co/gaiwan/compass/model/session.clj +++ b/src/co/gaiwan/compass/model/session.clj @@ -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))