From 9a33f05d23396d1ad9dd70e3b25fcddf044f89c1 Mon Sep 17 00:00:00 2001 From: Lucas Severo Date: Fri, 14 Aug 2020 18:53:09 -0300 Subject: [PATCH] fixed without-past-times to work with joda date-times --- CHANGES.org | 4 ++++ project.clj | 2 +- src/chime/core.clj | 2 +- test/chime_test.clj | 13 ++++++++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGES.org b/CHANGES.org index 8e4d37e..1502735 100644 --- a/CHANGES.org +++ b/CHANGES.org @@ -1,4 +1,8 @@ * Changes +** 0.3.3 +Changes: +- The without-past-times didn't work with joda dates, even with chime.joda-date imported. + ** 0.3.2 I left in some println debugging. Apologies. diff --git a/project.clj b/project.clj index 54f23ac..cf58b9e 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject jarohen/chime "0.3.2" +(defproject jarohen/chime "0.3.3-SNAPSHOT" :description "A really lightweight Clojure scheduler" :url "https://github.com/jarohen/chime" diff --git a/src/chime/core.clj b/src/chime/core.clj index 084fbb9..0595f1a 100644 --- a/src/chime/core.clj +++ b/src/chime/core.clj @@ -123,4 +123,4 @@ ([times now] (->> times - (drop-while #(.isBefore ^Instant % (->instant now)))))) + (drop-while #(.isBefore ^Instant (->instant %) now))))) diff --git a/test/chime_test.clj b/test/chime_test.clj index 4608a94..7a8e9d3 100644 --- a/test/chime_test.clj +++ b/test/chime_test.clj @@ -3,7 +3,10 @@ [chime :refer :all] [clojure.core.async :as a :refer [ (t/date-time 1990 1 1) + (t/from-time-zone (t/time-zone-for-offset -3)) + (clj-time.periodic/periodic-seq (t/days 1)) + (as-> x + (take 100 x)))] + (is (empty? (chime/without-past-times times)))))