This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-23
Channels
- # announcements (5)
- # babashka (22)
- # beginners (240)
- # calva (51)
- # clj-commons (1)
- # cljsrn (9)
- # clojars (12)
- # clojure (81)
- # clojure-australia (2)
- # clojure-europe (40)
- # clojure-france (10)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-uk (37)
- # clojurescript (59)
- # clojureverse-ops (2)
- # copenhagen-clojurians (1)
- # cursive (9)
- # datomic (18)
- # emacs (12)
- # fulcro (24)
- # graalvm (48)
- # hyperfiddle (5)
- # introduce-yourself (1)
- # jackdaw (1)
- # jobs (2)
- # juxt (8)
- # lsp (25)
- # malli (8)
- # missionary (1)
- # music (3)
- # off-topic (32)
- # polylith (16)
- # quil (4)
- # re-frame (52)
- # reitit (5)
- # reveal (3)
- # rewrite-clj (26)
- # rum (1)
- # sci (1)
- # shadow-cljs (14)
- # sql (2)
- # tools-build (40)
- # tools-deps (14)
- # vrac (2)
- # xtdb (63)
Hi - I've upgraded tick form 0.4.2.6-alpha to 0.4.3.2, my app is now blowing up. I used to used things like (tick/date "2021-09-23T14:16:00")
to get the date part and (tick/time "2021-09-23T14:16:00")
to get the time part but it seems unhappy about this now
am I missing something, is this deliberate, what's recommended practice here now ?
it works if I do (tick/date (tick/date-time "2021-09-23T14:16:00"))
I guess before I just hack in the fix I wanted to see if I had missed something
hmm looking at the docs I see any reference to calling time
on a date-time string so maybe that just kinda happened to work
appreciate I'm talking to myself at the moment but it seems like the version of js-joda/core required has gone from 1.x to 3.x so maybe that explains it
hi Ben. yes previously the parsing had a good go at working out what your string might be. this was very slow and might result in surprising behaviour. so, assuming you know the format of your input string, as you suggest, you should create the entity it corresponds to (date-time, in your case) then extract the bit you want. so, yes (tick/date (tick/date-time "2021-09-23T14:16:00"))`` is the right way to do it now.
gotcha thanks. I guess the problem I have now is working out where I need to convert to a date-time and when I just have dates which will teach me to write tests 😉