diff --git a/.gitignore b/.gitignore index 620b85a..c937688 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ out/ clojurescript/ doc/ bin/ +.idea/ diff --git a/src/cljs_time/core.cljs b/src/cljs_time/core.cljs index e77873f..fd35056 100644 --- a/src/cljs_time/core.cljs +++ b/src/cljs_time/core.cljs @@ -312,6 +312,16 @@ expected."} [] (doto (goog.date.UtcDateTime.) (.setTime 0))) +(defn min-date + "Minimum of the provided DateTimes." + [dt & dts] + (reduce #(if (before? %1 %2) %1 %2) dt dts)) + +(defn max-date + "Maximum of the provided DateTimes." + [dt & dts] + (reduce #(if (after? %1 %2) %1 %2) dt dts)) + (defn date-midnight "Constructs and returns a new DateTime at midnight in UTC.