From c18b5fc058e62ed89d075c1e220308023b8be1cd Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Tue, 2 Feb 2021 13:14:07 +0000 Subject: [PATCH] Fix weekly schedule --- src/timely/core.clj | 2 +- test/timely/test/core.clj | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/timely/core.clj b/src/timely/core.clj index 78317ae..b4b1a1c 100644 --- a/src/timely/core.clj +++ b/src/timely/core.clj @@ -155,7 +155,7 @@ specified, a default day of Sunday and a default hour and minute of 0 is used. Filters available: at, on, each, start-time, end-time" [& filters] - (apply (partial create-schedule 0 0 :all :all 0) filters)) + (apply (partial create-schedule 0 0 :all :all :sun) filters)) (defn monthly "Create a schedule that runs once every month. Optionally specify diff --git a/test/timely/test/core.clj b/test/timely/test/core.clj index 71831ae..20a0cb3 100644 --- a/test/timely/test/core.clj +++ b/test/timely/test/core.clj @@ -55,4 +55,5 @@ (is (= "* * * * *" (schedule-to-cron (each-minute (start-time 0) (end-time (* (dates-coerce/to-long (dates/now)) 2)))))) (is (= "* * * * *" (schedule-to-cron (each-minute (start-time (to-utc-timestamp (dates/date-time 2012 5 15 11 42))) - (end-time (to-utc-timestamp (dates/date-time 2012 5 15 11 43)))))))) + (end-time (to-utc-timestamp (dates/date-time 2012 5 15 11 43))))))) + (is (= "0 0 * * 6" (schedule-to-cron (weekly (on (day-of-week :sat)))))))