Daniel Compton

The personal blog of Daniel Compton - Projects

Plumatic Schema - specifying goog.date.UtcDateTime

Plumatic (nee Prismatic) Schema is a great tool for adding structural typing to your code.

Specifying standard Clojure types is fairly straightforward, but I recently needed to specify that a value was a goog.date.UtcDateTime. I did a bit of searching on Google, didn’t find anything. I then looked in the company codebase and found it. Here’s a minimal example:

(ns myns
  (:require [goog.date.UtcDateTime]))

(def Date js/goog.date.UtcDateTime)