TimeMath
TimeMath - Computation Helper for Rails Time Formats
Installation
Add this line to your application's Gemfile:
gem 'time_math'
And then execute:
$ bundle
Or install it yourself as:
$ gem install time_math
Usage
For "strftime" format:
SUM:
TimeMath.strftime(time_a, time_b).sum
DIFFERENCE:
TimeMath.strftime(time_a, time_b).diff
For "original" format:
DIFFERENCE:
TimeMath.realtime(time_a, time_b).diff
Usage in irb
require 'time_math'
For "strftime" format:
SUM:
TimeMath.strftime(time_a, time_b).sum
DIFFERENCE:
TimeMath.strftime(time_a, time_b).diff
For "original" format:
DIFFERENCE:
TimeMath.realtime(time_a, time_b).diff
Author
By: Oliver Jesus De Quintos
On: December 2015
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request