0.01
Low commit activity in last 3 years
No release in over a year
Chinese holidays
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 1.12, < 3.0
~> 10.0
~> 3.0
 Project Readme

Chinese::Holidays

Ruby Code Climate

提供具有中国特色的休假安排或者工作日查询。

Installation

Add this line to your application's Gemfile:

gem 'chinese-holidays'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chinese-holidays

Usage

元旦 = Date.new(2016, 1, 1)
# 是否休假(含正常的周六、周日)
Chinese::Holidays.is_holiday?(元旦)     # true
# 是否是工作日(含节假日的调休)
Chinese::Holidays.is_workdingday?(元旦) # fase


# 列出已知的特殊节假日
Chinese::Holidays.all.each do |holiday|
  puts "#{holiday.name} #{holiday.days.map {|date| date.strftime('%F')}}"
end
# 元旦 ["2016-01-01", "2016-01-02", "2016-01-03"]
# ...

支持

参考

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/chinese-holidays. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.