API reference
Operations
| Operation | Java | TypeScript | Python |
|---|---|---|---|
| List a year's holidays | getHolidays(year[, order]) | getHolidays(year[, order]) | get_holidays(year[, order]) |
| List a month's holidays | getHolidaysForMonth(year, month[, order]) | getHolidaysForMonth(year, month[, order]) | get_holidays_for_month(year, month[, order]) |
| Get a day's holiday object | getHoliday(LocalDate) / getHoliday(year, month, day) | getHoliday("YYYY-MM-DD") / getHoliday(year, month, day) | get_holiday(date) / get_holiday(year, month, day) |
| Check whether the day is a holiday | isHoliday(LocalDate) | isHoliday("YYYY-MM-DD") | is_holiday(date) |
In Java, the operations are static methods of
jp.kurashina.japanholidays.Holidays. Python's get_holiday and is_holiday
take positional arguments only.
Return types
| Result | Java | TypeScript | Python |
|---|---|---|---|
| Year and month listings | List<Holiday> | readonly Holiday[] | tuple[Holiday, ...] |
| Daily lookup | Optional<Holiday> | Holiday | null | Optional[Holiday] |
| Holiday check | boolean | boolean | bool |
Listings are read-only. For an ordinary day in a covered year, the check
returns false, and the daily lookup returns Optional.empty() in Java, null
in TypeScript, and None in Python.
Errors
| Case | Java | TypeScript | Python |
|---|---|---|---|
| Argument of the wrong type | NullPointerException for null | TypeError | TypeError |
| Invalid value of the right type | IllegalArgumentException | RangeError | ValueError |
Wrong types include a Date object in TypeScript, and a string or datetime
in Python. Invalid values include February 30, month 13, an unknown order, and
a year outside the coverage. Java date construction, such as
LocalDate.of(2026, 2, 30), may throw before calling Japan Holidays.
Dates
Dates use the Gregorian calendar without local time zone conversion. Java uses
LocalDate, Python uses datetime.date, and TypeScript uses YYYY-MM-DD
strings.
Searching by Japanese era input is deferred for the initial release. Searches accept Gregorian dates, and results include the Japanese era display date.