Japanese holiday.
This is an Clojure port of holiday-jp/holiday_jp-ruby, using holiday data of holiday-jp/holiday_jp.
We support Clojure, Clojerl, Clojure CLR and ClojureScript.
GPL-3.0-or-later
Add to deps.edn
.
{:deps {…
org.clojars.ne_sachirou/holiday-jp {:mvn/version "0.1.1"}}}
Add to rebar.config
.
{deps, […,
{holiday_jp, "~> 0.1.0", {pkg, holiday_jp_clje}}]}
between
returns a vector of holidays between the start and the last.
(is (= [{:date #inst "2021-01-01T00:00:00.000+09:00"
:week "金"
:week_en "Friday"
:name "元日"
:name_en "New Year's Day"}]
(holiday-jp/between #inst"2020-12-31T00:00:00+09:00" #inst"2021-01-02T00:00:00+09:00")))
holiday?
detects the date is a holiday or not.
(is (holiday-jp/holiday? #inst"2021-01-01T00:00:00+09:00"))
(is (not (holiday-jp/holiday? #inst"2021-01-02T00:00:00+09:00")))
on
returns a vector of holidays in the date.
(is (= [{:date #inst "2021-01-01T00:00:00.000+09:00"
:week "金"
:week_en "Friday"
:name "元日"
:name_en "New Year's Day"}]
(holiday-jp/on #inst"2021-01-01T00:00:00+09:00")))