XUtils

holi

Calendar operations that are aware of weekends and holidays


Holi

A library for calendar operations that are aware of weekends and holidays

build Clojars Project cljdoc badge

Examples

(ns my-app
  (:require [luciolucio.holi :as holi]
            [tick.core :as t]))

;      July 2019
; Su Mo Tu We Th Fr Sa
;     1  2  3  4  5  6
;  7  8  9 10 11 12 13
; 14 15 16 17 18 19 20
; 21 22 23 24 25 26 27
; 28 29 30 31

(holi/add (t/date "2019-07-12") 3 :business-days) ; 2020-07-17 (skips weekends)
(holi/add (t/date "2019-07-03") 1 :business-days "US") ; 2019-07-05 (skips 4th of July as a US holiday)

(holi/weekend? (t/date "2019-07-06")) ; -> true
(holi/holiday? (t/date "2019-07-04") "US") ; -> true

Use of juxt/tick is not required (but highly recommended).

Disclaimer

Holidays in holi have been put together to the best of the author’s knowledge, and are not guaranteed to be neither correct, complete nor historically accurate. You are encouraged to double-check the calendar showcase, the .hol files and perhaps the source to see if the calendar you want to use fits your use case. If you think there’s a mistake in a calendar, see I found a problem below.

Docs

Full holi documentation

I want custom holidays

Learn how to build yourself a custom library, with your own holiday calendars.


Articles

  • coming soon...