From 330a276f602aadfacdcc396667ee95a7167dfae4 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Fri, 13 Apr 2018 08:23:02 -0700 Subject: [PATCH] fixing minor bugs. --- src/cljs/auto_ap/effects.cljs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cljs/auto_ap/effects.cljs b/src/cljs/auto_ap/effects.cljs index fe436ca1..4c759f00 100644 --- a/src/cljs/auto_ap/effects.cljs +++ b/src/cljs/auto_ap/effects.cljs @@ -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