Elixir
Latest commit f609edb Feb 24, 2017 @ne-sachirou Show README on ex_doc
Permalink
Failed to load latest commit information.
config
holiday_jp @ f5d93c2
lib
priv
test
.gitignore
.gitmodules
.travis.yml
LICENSE
README.md
mix.exs
mix.lock

README.md

HolidayJp

Japanese holiday.

Hex.pm Build Status

This is an Elixir port of holiday-jp/holiday_jp-ruby, using holiday data of holiday-jp/holiday_jp.

Installation

Add holiday_jp to your list of dependencies in mix.exs:

def deps do
  [{:holiday_jp, "~> 0.2"}]
end

Add holiday_jp to your supervision tree in mix.exs.

def applications do
  [applications: [:holiday_jp]]
end

And fetch dependencies.

mix deps.get

Usage

iex> HolidayJp.between ~D[2016-03-01], ~D[2016-03-31]
[
  %HolidayJp.Holiday{date: ~D[2016-03-20], name: "春分の日", name_en: "Vernal Equinox Day", week: "", week_en: "Sunday"},
  %HolidayJp.Holiday{date: ~D[2016-03-21], name: "振替休日", name_en: "Holiday in lieu", week: "", week_en: "Monday"},
]

iex> HolidayJp.holiday? ~D[2017-01-02]
true

iex> HolidayJp.holiday? ~D[2016-01-02]
false

iex> HolidayJp.on ~D[2017-02-11]
[%HolidayJp.Holiday{date: ~D[2017-02-11], name: "建国記念の日", name_en: "National Foundation Day", week: "", week_en: "Saturday"}]

iex> HolidayJp.on ~D[2017-02-13]
[]