Applies all of the feedback for the new page
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
(ns auto-ap.time
|
||||
(:require [clj-time.core :as time]
|
||||
[clj-time.coerce :as coerce]
|
||||
[clj-time.format :as f]
|
||||
[auto-ap.logging :as alog]))
|
||||
|
||||
@@ -40,7 +41,7 @@
|
||||
|
||||
(defn unparse-local [v format]
|
||||
(try
|
||||
|
||||
|
||||
(f/unparse (f/with-zone (f/formatter format) (time/time-zone-for-id "America/Los_Angeles")) v)
|
||||
(catch Exception _
|
||||
nil)))
|
||||
@@ -52,3 +53,14 @@
|
||||
d
|
||||
(recur (time/plus d (time/days 1)))))]
|
||||
(iterate #(time/plus % (time/days 7)) next-day)))
|
||||
|
||||
(defn local-today []
|
||||
(coerce/in-time-zone (time/now) (time/time-zone-for-id "America/Los_Angeles")))
|
||||
|
||||
|
||||
(defn last-monday []
|
||||
(loop [current (local-now)]
|
||||
(if (= 1 (time/day-of-week current))
|
||||
current
|
||||
(recur (time/minus current (time/days 1))))))
|
||||
|
||||
Reference in New Issue
Block a user