diff --git a/src/metabase/util/date_2.clj b/src/metabase/util/date_2.clj index b8da94a7a28868fc1e904c079c1f714fa2756708..ab17d3ce9cf9c4c684c3c67e1d0b147f1d3a0dfe 100644 --- a/src/metabase/util/date_2.clj +++ b/src/metabase/util/date_2.clj @@ -379,8 +379,8 @@ ZonedDateTime (t/zoned-date-time)))) (defn older-than? - "True if temporal value `t` happened before some period/duration ago. Prefer this over using `t/before?` - because it is incredibly fussy about the classes of arguments it is passed. + "True if temporal value `t` happened before some period/duration ago, compared to now. Prefer this over using + `t/before?` to compare times to now because it is incredibly fussy about the classes of arguments it is passed. ;; did `t` happen more than 2 months ago? (older-than? t (t/months 2))" diff --git a/test/metabase/util/date_2_test.clj b/test/metabase/util/date_2_test.clj index fcae323a068ea3b050314afa1592dd4aecad9a9f..b792272b04ab702fced265345c9c3c2d3a627e44 100644 --- a/test/metabase/util/date_2_test.clj +++ b/test/metabase/util/date_2_test.clj @@ -381,7 +381,7 @@ (deftest older-than-test (let [now (t/instant "2019-12-04T00:45:00Z")] - (t/with-clock (t/mock-clock (t/zone-id "America/Los_Angeles")) + (t/with-clock (t/mock-clock now (t/zone-id "America/Los_Angeles")) (testing (str "now = " now) (doseq [t ((juxt t/instant t/local-date t/local-date-time t/offset-date-time identity) (t/zoned-date-time "2019-11-01T00:00-08:00[US/Pacific]"))]