(WIP) 開発中 under development
日本の法律に則った年齢計算です 年齢計算ニ関スル法律 - Wikipedia
年を取る日は誕生日の前日となる
Add this line to your application's Gemfile:
gem 'age_jp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install age_jp
Timecop.freeze(Time.new(2014, 12, 31))
birthday = Date.new(2000, 1, 1)
birthday.age # 14 (通常の年齢)
birthday.age_at(date) # same as birthday.age_at(Date.today)
birthday.age_jp # 15 (日本の法律準拠)
birthday.age_jp_at(date) # same as birthday.age_jp_at(Date.today)
birthday.east_asian_age_reckoning # 15 (数え年)
birthday.east_asian_age_reckoning_at(date) # same as birthday.east_asian_age_reckoning_at(Date.today)
- Fork it ( https://github.com/[my-github-username]/age_jp/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request