   in span-sized groups of unit (months or julians). [unit span] could be
   [julian 16], for example."
   [unit span start end]
-  (let [[years units] (map #(delta % start end) [year unit])]
+  (let [[years units] (map #(delta % start end) [time/year unit])]
     (+ (* years (per-year unit span))
        (quot units span))))
 

;; proper temporal comparison of two unrelated datasets.

(ns forma.date-time
  (:use [clj-time.core :only (now epoch date-time year month
                                  plus in-msecs in-minutes
                                  interval)]
        [clj-time.format :only (unparse formatters)]
        [clojure.string :only (split)]
        [clojure.contrib.math :only (ceil)]))

;; ### Reference Time
;;

(defn in-days
  "Returns the number of days spanned by the given time interval."
  [interval]
  (-> interval time/in-minutes (/ 60) (/ 24) int))

(defn julian
  "Returns the julian day index of a given date."
  [a]
  (in-days
   (time/interval (date-time (year a))
             a)))

;; the julian function complements the other "date-piece" functions
