This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-17
Channels
- # announcements (11)
- # babashka (29)
- # beginners (45)
- # biff (3)
- # cider (5)
- # clj-kondo (55)
- # clojure-austin (2)
- # clojure-europe (6)
- # clojure-norway (24)
- # clojure-uk (1)
- # datalevin (28)
- # fulcro (8)
- # gratitude (1)
- # hyperfiddle (7)
- # keechma (1)
- # membrane (31)
- # other-languages (1)
- # polylith (22)
- # shadow-cljs (12)
Hey all. I've been looking through a few Biff code bases and notice that wherever a date is required, it's schema defines it as: 'inst?' - why not something more specific which validates that is actually a date and not something else?
Is your point that inst?
returns true for both objects of type java.util.Date
and java.time.Instant
, and perhaps it'd be better to check explicitly for one or the other?
If so, that seems reasonable--using inst?
isn't something I've put much thought into. I see malli has some https://github.com/metosin/malli?tab=readme-ov-file#malliexperimentaltime for java.time
types; I'd be open to switching the starter and tutorial apps over to those.
Hey @U074GLVT6! I'm using the malli date and time schemas such as :time/local-date
in biff's schema.clj
file with just a couple of lines added to the "main" namespace:
(ns com.example
(:require ...
[malli.experimental.time :as met]
...))
...
(def malli-opts
{:registry (malr/composite-registry
malc/default-registry
(met/schemas) ; Enable malli experimental time schemas
(apply biff/safe-merge (keep :schema modules)))})