This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-23
Channels
- # announcements (3)
- # aws (2)
- # babashka (31)
- # beginners (14)
- # calva (14)
- # cider (4)
- # clj-kondo (1)
- # clojure (24)
- # clojure-europe (18)
- # clojure-gamedev (4)
- # clojure-nl (3)
- # clojure-norway (23)
- # clojurescript (24)
- # core-typed (23)
- # data-science (9)
- # datomic (1)
- # emacs (15)
- # events (4)
- # gratitude (3)
- # introduce-yourself (1)
- # leiningen (9)
- # lsp (65)
- # membrane (39)
- # music (1)
- # nbb (1)
- # obb (8)
- # reitit (17)
- # releases (1)
- # tree-sitter (2)
- # vim (28)
- # xtdb (3)
I’m sure I’m doing something wrong here as I’m still a relative beginner. I’m trying to make use of cljs.java-time
without luck so far. Here’s what I believe to be a clean test, but I’m not sure what’s wrong. Any hints?
% bb
Downloading: com/cognitect/aws/glue/822.2.1193.0/glue-822.2.1193.0.pom from central
Downloading: org/clojure/pom.contrib/1.1.0/pom.contrib-1.1.0.pom from central
Downloading: com/cognitect/aws/chime-sdk-identity/821.2.1107.0/chime-sdk-identity-821.2.1107.0.pom from central
Downloading: org/clojure/clojure/1.11.1/clojure-1.11.1.pom from central
Downloading: com/cognitect/aws/apigateway/822.2.1171.0/apigateway-822.2.1171.0.pom from central
Downloading: com/cognitect/aws/endpoints/1.1.12.307/endpoints-1.1.12.307.pom from central
Downloading: org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.pom from central
Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.pom from central
Downloading: com/widdindustries/cljs.java-time/0.1.20/cljs.java-time-0.1.20.pom from clojars
Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar from central
Downloading: com/cognitect/aws/apigateway/822.2.1171.0/apigateway-822.2.1171.0.jar from central
Downloading: com/cognitect/aws/glue/822.2.1193.0/glue-822.2.1193.0.jar from central
Downloading: com/cognitect/aws/chime-sdk-identity/821.2.1107.0/chime-sdk-identity-821.2.1107.0.jar from central
Downloading: com/cognitect/aws/endpoints/1.1.12.307/endpoints-1.1.12.307.jar from central
Downloading: org/clojure/clojure/1.11.1/clojure-1.11.1.jar from central
Downloading: org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar from central
Downloading: com/widdindustries/cljs.java-time/0.1.20/cljs.java-time-0.1.20.jar from clojars
Babashka v1.0.164 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (require '[cljc.java-time.local-date :as ld])
java.lang.Exception: Could not find namespace: cljc.java-time.local-date. [at <repl>:1:1]
user=>
is that not a typo there at your REPL prompt cljc.java-time
as opposed to cljs.java-time
?
one sec, I’m going to put my head through the wall if that’s the case . Standby
:man-facepalming:
Ok - there is both a cljs.java-time
lib and a cljc.java-time
lib. I was reading docs for one and using the other.
Thanks sir!
This is in the category of "useless advice" but having experienced much in the way of painful datetime libraries, I have come to really enjoy tick
, it works the way I would expect it to with very minimal issues
and I think it is both CLJ and CLJS compatible
Well - that’s good advice actually. As I’m new to clojure, I have no preference and was just looking for a way to deal with iso8601 dates that works in babashka. So Thanks, I’ll check that out!
@U03QBKTVA0N Are you using tick in babashka by chance?
Regrettably not, and I am uncertain of its functionality therein
I am sure that when the BB wizards come back online they will have good answers for you--better than mine certainly
Ok no problem, thanks (I think it may be incompatible). However, I also use straight clojure - so this was a good tip anyhow. Thanks again 🙂
just to add some color vis-a-vis some prior investigation into tick compatibility with bb: <https://github.com/babashka/babashka/issues/554> - tl;dr tick has some blockers to compatibility with bb; cljc.java-time is compatible (it's actually one of the libraries that gets tested with each build)
You can also use Java interop directly. java.time is supposed to work: if something is missing, please report it
Thanks guys. After exploring many routes, I went with interop. For anyone that comes after, here’s what I did:
;; Read "zoned" ISO8601 timestamp and return a string in human readable local time
(import [java.time.format DateTimeFormatter]
[java.time ZonedDateTime ZoneId])
(defn lt1 [ts]
(let [format-string "eeee, MMMM d - h:mm:ss a"
format (DateTimeFormatter/ofPattern format-string)
ISO-8601 (DateTimeFormatter/ofPattern "yyyyMMdd'T'HHmmssXXXXX")]
(-> (ZonedDateTime/parse ts ISO-8601) (.withZoneSameInstant (ZoneId/systemDefault)) (.format format))))
(println (lt1 "20221023T051551Z"))
Hi!
For a while, I've been working on https://play.teod.eu/. It's for learning and exploring stuff. Under the hood, it's a big pile of EDN, pandoc, some org-mode/org-roam/emacs lisp, tied together with a babashka/cli
tool. I'm sharing my workflow in today's visual tools meeting. Expect this to be informal and unpolished.
Posting here since http://play.teod.eu is heavily based on babashka.
title: Knowledge management on http://play.teod.eu
date: today - October 23rd
time: 15:00 UTC / 17:00 CET
more info & zoom link: https://clojureverse.org/t/visual-tools-meeting-15-a-common-ground-for-notes-with-kindly
I’m thinking of converting a leiningen project to deps.edn and want to smooth over some of the cli complexity (aliases etc) with babashka as a task runner. Has anyone done this before? Any tips or tricks?
I’ll post some tips and tricks when I’m back home but the book should give you all you need. The clojure function and shell function are available by default
Cool, I’m reading through it now.
I'm pretty happy about this one: https://github.com/clj-kondo/clj-kondo.lsp/blob/master/bb.edn
so, for complex clojure
invocations, you can just write (clojure "-T:build deploy")
or whatever
Excellent, thank you for the complex examples
recently I've been putting more code in regular .clj
files in a bb
directory that I then hook up to tasks
because bb.edn
doesn't have linting (yet) and coding in regular .clj
files is more comfortable
That’s clever