Skip to content

ne-sachirou/holiday-jp-clojure

Repository files navigation

holiday-jp

Test Clojars Project Hex.pm

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 {…
        org.clojars.ne_sachirou/holiday-jp {:mvn/version "0.1.1"}}}

Clojerl

Add to rebar.config.

{deps, […,
        {holiday_jp, "~> 0.1.0", {pkg, holiday_jp_clje}}]}

Clojure CLR

Usage

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")))

About

Japanese holiday.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages