This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-09
Channels
- # aws (3)
- # beginners (61)
- # boot (1)
- # cider (80)
- # clara (5)
- # cljs-dev (5)
- # cljsrn (19)
- # clojure (40)
- # clojure-dev (29)
- # clojure-dusseldorf (2)
- # clojure-greece (21)
- # clojure-italy (16)
- # clojure-russia (7)
- # clojure-spec (31)
- # clojure-uk (70)
- # clojurescript (31)
- # cursive (21)
- # data-science (5)
- # emacs (7)
- # fulcro (23)
- # graphql (4)
- # java (18)
- # jobs (1)
- # jobs-discuss (25)
- # juxt (14)
- # nrepl (2)
- # off-topic (18)
- # om-next (2)
- # onyx (3)
- # re-frame (16)
- # reagent (50)
- # ring-swagger (5)
- # shadow-cljs (70)
- # specter (5)
- # sql (24)
- # tools-deps (16)
- # vim (41)
any suggestions where to find (libs maybe?) specs for strings contaning datetime in the ISO 8601 format
not sure if i expressed my self properly, but id like to validate if a strings conforms to the iso, so
(s/valid? ::iso-spec "2018-05-06T13:14Z")
shoud evaluate to true
#(try (java.time.OffsetDateTime/parse %) (catch java.time.DateTimeParseException e false))
i wouldn't pull in any of the clj date time libraries, they all have serious defects compared to java.time
@ghadi That's a bit of a sweeping statement. Could you provide a bit more specificity?
(we are using clojure.java-time
which is a thin wrapper around Java Time that automates the chains of conversions between (Java) types)
The clj-time
readme already tells people not to use it if they're on Java 8 or later -- and recommends Java Time instead, optionally using clojure.java-time
as a wrapper.
Fair enough. I find Java Time's raw classes to be a bit ugly if you're doing anything more than basic stuff. I find clojure.java-time
's wrapper much more pleasant for more complex date/time arithmetic/manipulation.
I don't see it pulling in potemkin. clj-tuple has no dependencies.
My teammate is also a fan of direct Java interop rather than wrappers, but some interop code can definitely be made cleaner with wrappers (in this particular context, as we've seen in code reviews during pull requests).
Yeah, and I'll take that little bit of potemkin code but I agree that I wouldn't want the whole thing pulled in...
these libraries add nothing to your understanding of the primitives, and introduce new names for everything
what are the issues with clj-time? just the parallel "adds no value over joda"?
I've been using it for years and haven't noticed anything
joda itself had serious design issues that the authors rectified as it became java.time
coolthx
@U0GN0S72R FWIW, the readme of clj-time
points to Joda Time's recommendation to migrate to Java Time and that links to several articles I think.
(esp. if you're unfortunately enough to have to convert back and forth with java.util.Date
and/or any of the SQL date/time types!)