0.01
No commit activity in last 3 years
No release in over 3 years
Lunar calendar, Solar calendar convertor
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
~> 10.0
~> 3.0
 Project Readme

LunarBlessing

LunarBlessing is created for converting Chinese Lunar Calendar date to Solar Calendar date. It supports years from 1900 to 2099.

Now LunarBlessing is not supporting convert Solar date to Lunar date, but it's already in todo list. We will add this feature when we need it. So if you wanna contribute, that would be awesome.

Name

This gem name is inspried by a DOTA HERO called Luna, she has a abilitie called Lunar Blessing.

Installation

Add this line to your application's Gemfile:

gem 'lunar_blessing', github: 'mycolorway/lunar_blessing'

And then execute:

$ bundle

Now this gem is not published to rubygems.org yet, so install with git or local is neccessary.

Usage

lunar_date = LunarBlessing::Date.new(year: 2015, month: 12, day: 28)
lunar_date.to_solar #=> '2016-02-06'
lunar_date.to_s #=> '腊月廿八'
lunar_date.to_s(with_year: true) #=> '二〇一六年腊月廿八'

Requirement

This gem only support Ruby version >= 2.1, because we use 'keyword arguments' feature. If you want to remove it and support other ruby versions, a PR is welcome.

License

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

TODO

  • Add to_s for LunarBlessing:Date
  • Convert solar date to lunar date
  • Write document