JapaneseHoliday

1.2.1

417-72KI/JapaneseHoliday

What's New

1.2.1

2025-03-30T16:23:56Z

What's Changed

Full Changelog: 1.2.0...1.2.1

JapaneseHoliday

Actions Status GitHub release Swift Package Manager GitHub license

A library for calculating Japanese holidays.

It crawls the official website of the Japanese government and extracts the data of the holidays.

See also https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html

Note

Date caculation is based on Japanese Standard Time (JST).

Installation

Set

.package(url: "https://github.com/417-72KI/JapaneseHoliday.git", from: "1.2.1"),

in package dependencies and

"JapaneseHoliday",

in target dependencies.

Usage

import JapaneseHoliday

let holiday = JapaneseHoliday.holiday(ofDate: .now)

print("Today is \(holiday?.name ?? "not a holiday")")

Add a custom holiday

import JapaneseHoliday

JapaneseHoliday.addCustomHoliday(forMonth: 1, day: 2, named: "三が日")
JapaneseHoliday.addCustomHoliday(forMonth: 1, day: 3, named: "三が日")

let holiday = JapaneseHoliday.holiday(ofDate: Date(timeIntervalSince1970: 1735743600)) // 2025-01-02 00:00:00 GMT+9
print("2025-01-02 is \(holiday?.name ?? "not a holiday")")

Author

417-72KI

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun May 04 2025 02:49:31 GMT-0900 (Hawaii-Aleutian Daylight Time)