fixing minor bugs.
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
(re-frame/reg-fx
|
||||
:redirect
|
||||
(fn [uri]
|
||||
(println uri)
|
||||
(pushy/set-token! p/history uri)))
|
||||
|
||||
(re-frame/reg-fx
|
||||
@@ -24,7 +23,10 @@
|
||||
(if value
|
||||
(.setItem js/localStorage name value)
|
||||
(.removeItem js/localStorage name ))))
|
||||
(def is-8601 #"^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$")
|
||||
|
||||
;; 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$")
|
||||
|
||||
|
||||
(defn dates->date-times [x]
|
||||
(walk/postwalk
|
||||
@@ -34,10 +36,13 @@
|
||||
(and (string? node)
|
||||
(re-matches is-8601 node))
|
||||
(do
|
||||
(println node)
|
||||
(format/parse (format/formatters :date-time) node))
|
||||
|
||||
(instance? js/Date node)
|
||||
(time/to-default-time-zone (c/from-date node))
|
||||
(do
|
||||
(println node)
|
||||
(time/to-default-time-zone (c/from-date node)))
|
||||
|
||||
|
||||
:else
|
||||
|
||||
Reference in New Issue
Block a user