Use n = 0
to get same or next semantics, that is:
n = 1
(ns my-app
(:require [luciolucio.holi :as holi]
[tick.core :as t]))
(holi/add (t/date "2022-07-06") 0 :business-days) ; -> 2022-07-08, because 2022-07-06 is a Saturday
(holi/add (t/date "2022-07-07") 0 :business-days) ; -> 2022-07-08, because 2022-07-07 is a Sunday
(holi/add (t/date "2022-07-08") 0 :business-days) ; -> 2022-07-08, as it's a regular Monday
One situation where this is useful is, say, when something is "due next month, on the same day of the month, but in case that's a weekend then it's only due the following business day":
(-> (t/date "2022-06-06")
(holi/add 1 :months) ; 2022-07-06, Sat
(holi/add 0 :business-days)) ; 2022-07-08, Mon
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close