SinceWhen
Returns a string containing the amount of time since the date given with varying scopes of specificy.
Installation
Add this line to your application's Gemfile:
gem 'since_when'
And then execute:
$ bundle
Or install it yourself as:
$ gem install since_when
Usage
SinceWhen::time_since( date, :scope )
Example:
example_date = Date.new(2001, 2, 3)
SinceWhen::time_since( example_date, :month )
>> "12 years 8 months"
# or
SinceWhen::time_since( example_date, :day)
>> "12 years 8 months 12 days"
Contributing
- Fork it
- 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 new Pull Request