https://github.com/verified-holidays/verified_holidays
Japanese holiday gem — verified weekly against the Cabinet Office official CSV
https://github.com/verified-holidays/verified_holidays
cabinet-office gem holidays japanese-holidays ruby
Last synced: 3 months ago
JSON representation
Japanese holiday gem — verified weekly against the Cabinet Office official CSV
- Host: GitHub
- URL: https://github.com/verified-holidays/verified_holidays
- Owner: verified-holidays
- License: mit
- Created: 2026-03-20T06:52:43.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-29T10:11:59.000Z (3 months ago)
- Last Synced: 2026-03-29T10:26:23.664Z (3 months ago)
- Topics: cabinet-office, gem, holidays, japanese-holidays, ruby
- Language: Ruby
- Homepage: https://rubygems.org/gems/verified_holidays
- Size: 41 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# VerifiedHolidays
[](https://github.com/verified-holidays/verified_holidays/actions/workflows/test.yml)
[](https://github.com/verified-holidays/verified_holidays/actions/workflows/verify.yml)
[](https://badge.fury.io/rb/verified_holidays)
[](https://qlty.sh/gh/verified-holidays/projects/verified_holidays)
[](https://qlty.sh/gh/verified-holidays/projects/verified_holidays)
[](https://opensource.org/licenses/MIT)
Japanese national holiday gem with **weekly verification against the Cabinet Office official data**.
If the verification badge is green, the holiday data is correct.
## Why "verified_holidays"?
Because the data is **verified**. Every week, GitHub Actions checks our built-in
holiday data against the Cabinet Office official CSV. If it matches, the badge
stays green.
## Installation
```ruby
gem "verified_holidays"
```
## Usage
```ruby
require "verified_holidays"
# Check if a date is a holiday
VerifiedHolidays.holiday?(Date.new(2026, 1, 1)) # => true
VerifiedHolidays.holiday?(Date.new(2026, 3, 19)) # => false
# Date, DateTime, Time are all accepted
VerifiedHolidays.holiday?(Time.new(2026, 1, 1)) # => true
# Get holidays in a date range
holidays = VerifiedHolidays.between(Date.new(2026, 1, 1), Date.new(2026, 12, 31))
holidays.each do |h|
puts "#{h.date} #{h.name} (#{h.name_en})"
end
# Get the holiday name
VerifiedHolidays.name(Date.new(2026, 1, 1)) # => "元日"
VerifiedHolidays.name(Date.new(2026, 3, 19)) # => nil
# Get all holidays for a year
VerifiedHolidays.year(2026)
# => [#, ...]
```
### Holiday object
```ruby
holiday = VerifiedHolidays.between(Date.new(2026, 1, 1), Date.new(2026, 1, 1)).first
holiday.date # => #
holiday.name # => "元日"
holiday.name_en # => "New Year's Day"
holiday.wday_name # => "Thursday"
holiday.week # => "Thursday" (alias for wday_name)
```
## Migration from holiday_jp
Replace:
```ruby
require "holiday_jp"
```
with:
```ruby
require "verified_holidays/holiday_jp_compat"
```
That's it. `HolidayJp.holiday?`, `HolidayJp.between`, and `HolidayJp::Holiday` all work as before.
## Verification
This gem verifies its built-in data against the [Cabinet Office CSV](https://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv) every week via GitHub Actions.
You can also run the verification yourself:
```ruby
result = VerifiedHolidays.verify!
result.valid? # => true
result.missing # => entries in local data but not in Cabinet Office CSV
result.extra # => entries in Cabinet Office CSV but not in local data
result.mismatched # => entries with different names
```
Or via Rake:
```sh
bundle exec rake verified_holidays:verify
```
## Data Source
Holiday data is sourced from the Cabinet Office of Japan (内閣府):
https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html
The data is provided under the terms of the [Government of Japan Standard Terms of Use](https://www.kantei.go.jp/jp/singi/it2/densi/kettei/gl2_betten_1.pdf) (CC BY compatible).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/verified-holidays/verified_holidays.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).