   (year [n] (Year/of n))
 
   LocalDate
+  (time [d] (midnight d)) ; this helps iCalendar dates become intervals
   (date [d] d)
   (day [d] (.getDayOfWeek d))
   (day-of-month [d] (.getDayOfMonth d))

  (> [x y] (.isAfter x y))
  (>= [x y] (not (.isBefore x y))))

(defprotocol ITimeArithmetic
  (+ [_ _] "Add time")
  (- [_ _] "Subtract time")
  (inc [_] "Increment time")
  (dec [_] "Decrement time")
  (maximum [_ _] "Return maximum")
  (minimum [_ _] "Return minimum"))

(defn max [arg & args]
  (reduce #(maximum %1 %2) arg args))


  (if *clock*
    (LocalDate/now *clock*)
    (LocalDate/now)))

(defprotocol ITimeArithmetic
  (+ [_ _] "Add time")
  (- [_ _] "Subtract time")
  (inc [_] "Increment time")
  (dec [_] "Decrement time")
  (maximum [_ _] "Return maximum")
  (minimum [_ _] "Return minimum"))

(defn tomorrow []
  (+ (today) 1))

(defn yesterday []
  (- (today) 1))

(defprotocol ITimeAt
  (on [_ _] "Set time be ON a date")
  (at [_ _] "Set date to be AT a time")  )

(defn midnight [^LocalDate date]
  (at date (LocalTime/MIDNIGHT)))

(defn noon [^LocalDate date]
  (at date (LocalTime/NOON)))

(defn epoch []
  (java.time.Instant/EPOCH))
