Skip to content

conversions, validations and helpers to deal with elapsed time as english and stored as seconds

License

Notifications You must be signed in to change notification settings

sbfaulkner/elapsed_time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElapsedTime

Add support for converting an English representation of elapsed time into seconds and back (with validation).

Example

"1 day, 10 hours, 17 minutes and 36 seconds".parse_elapsed_time
=> 123456

123456.to_elapsed_time
=> "1 day, 10 hours, 17 minutes and 36 seconds"

class Job < ActiveRecord::Base
  elapsed_time :estimate
  validates_elapsed_time_of :estimate, :allow_nil => true
end

TODO

  • documentation

Legal

Author: S. Brent Faulkner brentf@unwwwired.net
License: Copyright © 2008-2010 unwwwired.net, released under the MIT license

About

conversions, validations and helpers to deal with elapsed time as english and stored as seconds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages