holiday-jp

Test

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.

LICENSE

GPL-3.0-or-later

Installation

Clojure, ClojureScript

Add to deps.edn.

{:deps {
com.github.holidayjp/holiday-jp-clj {:mvn/version "0.1.0"}}}

Clojerl

Add to rebar.config.

{deps, [,
{holiday-jp, {git, "https://github.com/ne-sachirou/holiday-jp-clojure.git", {branch, "main"}}}]}

Clojure CLR

Usage

between returns a vector of holidays between the start and the last.

(is (= [{:date #inst "2021-01-01T00:00:00.000-00:00"
:week "金"
:week_en "Friday"
:name "元日"
:name_en "New Year's Day"}]
(holiday-jp/between #inst"2020-12-31" #inst"2021-01-02")))

holiday? detects the date is a holiday or not.

(is (holiday-jp/holiday? #inst"2021-01-01"))
(is (not (holiday-jp/holiday? #inst"2021-01-02")))

on returns a vector of holidays in the date.

(is (= [{:date #inst "2021-01-01T00:00:00.000-00:00"
:week "金"
:week_en "Friday"
:name "元日"
:name_en "New Year's Day"}]
(holiday-jp/on #inst"2021-01-01")))