weekly debits/credits.

This commit is contained in:
Bryce Covert
2020-05-30 11:49:21 -07:00
parent 3101dd1fe6
commit bb2df01d89
9 changed files with 140 additions and 56 deletions

View File

@@ -20,3 +20,11 @@
(f/unparse (f/formatter format) v)
(catch Exception e
nil)))
(defn day-of-week-seq [day]
(let [next-day (loop [d (auto-ap.time/local-now)]
(if (= (time/day-of-week d) day)
d
(recur (time/plus d (time/days 1)))))]
(iterate #(time/plus % (time/days 7)) next-day)))