clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
coby 2020-07-12T17:11:49.470300Z

Hey all, I want to check my intuition about something I'm trying to model. I need to design a small API for taking calendar availabilities (start/end pairs of date-times) and returning available appointment windows (also as start/end pairs, and also taking existing appointment times into account). Spec provides inst-in which is very nice, but I need to do a bunch of date comparisons, for which it's much nicer (IMHO) to use clojure.java-time. So would the recommended approach be to convert all datetimes to/from java-time at the edges of the API, and take/return insts?

alexmiller 2020-07-12T19:24:06.471700Z

inst is backed by a protocol so you don’t actually need to convert, just ensure the type you’re using extends Inst

1