HolidayJp v0.2.2 HolidayJp View Source

Japanese holiday.

Link to this section Summary

Functions

Returns holidays in Japan between start and last

Detect the date is a holiday in Japan

Returns a list of holidays on the date

Link to this section Types

Link to this type holiday() View Source
holiday() :: %HolidayJp.Holiday{date: %Date{calendar: term, day: term, month: term, year: term}, name: binary, name_en: binary, week: binary, week_en: binary}

Link to this section Functions

Link to this function between(start, last) View Source
between(%Date{calendar: term, day: term, month: term, year: term}, %Date{calendar: term, day: term, month: term, year: term}) :: [holiday]

Returns holidays in Japan between start and last.

iex> HolidayJp.between ~D[2016-03-01], ~D[2016-03-31]
[
  %HolidayJp.Holiday{date: ~D[2016-03-20], week: "日", week_en: "Sunday", name: "春分の日", name_en: "Vernal Equinox Day"},
  %HolidayJp.Holiday{date: ~D[2016-03-21], week: "月", week_en: "Monday", name: "振替休日", name_en: "Holiday in lieu"},
]
Link to this function holiday?(date) View Source
holiday?(%Date{calendar: term, day: term, month: term, year: term}) :: boolean

Detect the date is a holiday in Japan.

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

iex> HolidayJp.holiday? ~D[2016-01-02]
false
Link to this function on(date) View Source
on(%Date{calendar: term, day: term, month: term, year: term}) :: [holiday]

Returns a list of holidays on the date.

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

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