https://github.com/ne-sachirou/holiday-jp-clojure
Japanese holiday.
https://github.com/ne-sachirou/holiday-jp-clojure
clojerl clojure clojurescript
Last synced: 10 days ago
JSON representation
Japanese holiday.
- Host: GitHub
- URL: https://github.com/ne-sachirou/holiday-jp-clojure
- Owner: ne-sachirou
- License: gpl-3.0
- Created: 2021-01-02T19:01:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T15:26:48.000Z (4 months ago)
- Last Synced: 2025-04-15T18:55:50.537Z (about 1 month ago)
- Topics: clojerl, clojure, clojurescript
- Language: Clojure
- Homepage:
- Size: 86.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# holiday-jp
[](https://github.com/ne-sachirou/holiday-jp-clojure/actions?query=workflow:Test)
[](https://clojars.org/org.clojars.ne_sachirou/holiday-jp)
[](https://hex.pm/packages/holiday_jp_clje)Japanese holiday.
This is an Clojure port of [holiday-jp/holiday_jp-ruby](https://github.com/holiday-jp/holiday_jp-ruby), using holiday data of [holiday-jp/holiday_jp](https://github.com/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`.
```clojure
{:deps {…
org.clojars.ne_sachirou/holiday-jp {:mvn/version "0.1.1"}}}
```### Clojerl
Add to `rebar.config`.
```erlang
{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.
```clojure
(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.
```clojure
(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.
```clojure
(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")))
```