Skip to content

Commit

Permalink
Made a few fns in input-time public to avoid compiler warnings with t…
Browse files Browse the repository at this point in the history
…he latest cljs as the tests use them
  • Loading branch information
Gregg8 committed Nov 27, 2018
1 parent 64f7b1f commit 3536996
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/re_com/input_time.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
(filter (comp not nil?)))) ;; of the 9 items, there should be only 3 non-nil matches coresponding to H : M


(defn- text->time
(defn text->time
"return as a time int, the contents of 'text'"
[text]
(->> text
Expand All @@ -56,22 +56,22 @@
triple->time)) ;; turn the triple of values into a single int


(defn- time->text
(defn time->text
"return a string of format HH:MM for 'time'"
[time]
(let [hrs (time->hrs time)
mins (time->mins time)]
(str (pad-zero-number hrs 2) ":" (pad-zero-number mins 2))))

(defn- valid-text?
(defn valid-text?
"Return true if text passes basic time validation.
Can't do to much validation because user input might not be finished.
Why? On the way to entering 6:30, you must pass through the invalid state of '63'.
So we only really check against the triple-extracting regular expression"
[text]
(= 3 (count (extract-triple-from-text text))))

(defn- valid-time?
(defn valid-time?
[time]
(cond
(nil? time) false ;; can't be nil
Expand Down

0 comments on commit 3536996

Please sign in to comment.