This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-07
Channels
- # adventofcode (114)
- # announcements (3)
- # aws (5)
- # babashka (62)
- # beginners (111)
- # calva (4)
- # cider (20)
- # clara (5)
- # clj-kondo (1)
- # cljs-dev (9)
- # clojure (255)
- # clojure-europe (75)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-uk (6)
- # clojuredesign-podcast (5)
- # clojurescript (34)
- # community-development (28)
- # conjure (1)
- # cursive (3)
- # data-science (1)
- # datavis (1)
- # datomic (4)
- # figwheel-main (1)
- # fulcro (14)
- # graalvm (1)
- # graphql (8)
- # integrant (4)
- # introduce-yourself (2)
- # jobs (2)
- # juxt (4)
- # kaocha (2)
- # malli (6)
- # membrane-term (53)
- # mount (2)
- # nextjournal (2)
- # off-topic (27)
- # pathom (11)
- # polylith (3)
- # portal (11)
- # reagent (4)
- # reitit (4)
- # remote-jobs (1)
- # reveal (14)
- # shadow-cljs (22)
- # tools-deps (24)
- # vim (6)
- # xtdb (19)
This is probably more of a cljc.java-time question, but hopefully OK to ask here: I'm looking to get the week number of a date. I'm currently doing this:
user=> (cljc.java-time.temporal.temporal/get (tick/new-date 2012 12 31) (.weekOfYear WeekFields/ISO))
53
It'd be nice not to need to import java.time.temporal.WeekFields
, though. Is there a cross-platform way to do this? I couldn't find one by searching the sources.hmm, yeah week fields hasnt been generated. probably can do that. googling got this, https://www.baeldung.com/java-get-week-number, which says this is alternative:
(-> (cljc.java-time.local-date/now)
(cljc.java-time.local-date/get
cljc.java-time.temporal.chrono-field/aligned-week-of-year))