TimeBucket
For finding the time buckets.
Installation
Add this line to your application's Gemfile:
gem 'time_bucket'
And then execute:
$ bundle
Or install it yourself as:
$ gem install time_bucket
Usage
TimeBucket.bucket_from_seconds(Time.now - 2.days.ago)
# => "longer than 1 day"
TimeBucket.bucket_from_seconds(Time.now - 20.minutes.ago)
# => "30 minutes"
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