This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-03
Channels
- # announcements (4)
- # aws (19)
- # babashka (55)
- # beginners (40)
- # biff (4)
- # calva (9)
- # cherry (3)
- # cider (8)
- # clj-kondo (26)
- # clj-yaml (3)
- # clojure (92)
- # clojure-austin (14)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-portugal (3)
- # clojure-uk (2)
- # clojurescript (48)
- # conjure (19)
- # datalevin (14)
- # docker (13)
- # emacs (3)
- # fulcro (21)
- # gratitude (14)
- # improve-getting-started (1)
- # introduce-yourself (2)
- # joker (4)
- # juxt (2)
- # lsp (12)
- # malli (5)
- # meander (17)
- # off-topic (13)
- # re-frame (7)
- # scittle (2)
- # test-check (2)
I got a question on juxt/tick
. I'm pretty familiar with js-joda (and java time). I'm using tick
in the frontend where i get a js-joda LocalDate
back from a datepicker component, and I want to convert it to a native inst
. If i try t/inst
I get an exception like this:
No protocol method IConversion.inst defined for type object: 2022-10-03
The type is LocalDate
, presumably from js-joda
. Now I could use the js-joda
approach by doing .atStartofDay
to get a LocalDateTime
and then convert that to an instant, but what would be the pure tick
approach?there isn't a pure tick approach for that afaik. I'd drop to calling atstartofday, using the fn via https://github.com/henryw374/cljc.java-time to be sure it works cross platform. and I'd call the 2-arg version to be explicit about the zone - see https://github.com/juxt/tick#instants. once you have zoneddatetime from that, you can call t/instant to get the end result
✅ 1