https://github.com/dbackowski/duration_helpers
Duration helpers for Rails.
https://github.com/dbackowski/duration_helpers
Last synced: 9 months ago
JSON representation
Duration helpers for Rails.
- Host: GitHub
- URL: https://github.com/dbackowski/duration_helpers
- Owner: dbackowski
- License: mit
- Created: 2014-10-24T08:38:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-10T07:32:33.000Z (about 11 years ago)
- Last Synced: 2025-05-21T09:55:56.272Z (about 1 year ago)
- Language: Ruby
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DurationHelpers [](https://travis-ci.org/dbackowski/duration_helpers)
DurationHelpers provides rails helpers for converting duration in H:M:S format to seconds and seconds to duration in H:M:S format.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'duration_helpers'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install duration_helpers
## Usage
duration_to_seconds('00:00:12')
=> 12
seconds_to_duration(12)
=> "00:00:12"
## Contributing
1. Fork it ( https://github.com/dbackowski/duration_helpers/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request