setup for clients moving much faster

This commit is contained in:
2023-04-05 14:42:25 -07:00
parent d59059fee2
commit 406cddf6e6
3 changed files with 53 additions and 32 deletions

View File

@@ -1,5 +1,7 @@
(ns iol-ion.query
(:require [clj-time.core :as time]))
(:require [clj-time.core :as time]
[clj-time.coerce :as coerce]
[clj-time.format :as f]))
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn dollars-0? [amt]
@@ -9,5 +11,19 @@
(defn dollars= [amt1 amt2]
(dollars-0? (- amt1 amt2) ))
(defn localize [d]
(time/to-time-zone d (time/time-zone-for-id "America/Los_Angeles")))
(defn local-now []
(time/to-time-zone (time/now) (time/time-zone-for-id "America/Los_Angeles")))
(localize (time/now)))
(defn recent-date []
(coerce/to-date (time/minus (local-now) (time/days 90))))
(def excel-formatter (f/with-zone (f/formatter "MM/dd/yyyy") (time/time-zone-for-id "America/Los_Angeles")))
(defn excel-date [d]
(->> d
(coerce/to-date-time)
localize
(f/unparse excel-formatter )))