supports terms.

This commit is contained in:
Bryce Covert
2020-04-18 10:09:19 -07:00
parent b28dd64c4a
commit fc9f94a64d
5 changed files with 46 additions and 17 deletions

View File

@@ -32,6 +32,8 @@
;; 2017-09-19T07:00:00.000Z
(def is-8601 #"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$")
(def is-year-month-day #"^\d{4}-\d{2}-\d{2}$")
(defn dates->date-times [x]
(walk/postwalk
@@ -42,6 +44,10 @@
(re-matches is-8601 node))
(format/parse (format/formatters :date-time) node)
(and (string? node)
(re-matches is-year-month-day node))
(time/from-default-time-zone (format/parse (format/formatters :year-month-day) node))
(instance? js/Date node)
(time/to-default-time-zone (c/from-date node))