Skip to content

jgaskins/time-span-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time::Span::Format

This mixin added to Time::Span adds two to_s overloads that works similarly to Time#to_s(format : String).

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      time-span-format:
        github: jgaskins/time-span-format
  2. Run shards install

Usage

require "time-span-format"

duration = Time.measure do
  # do some work
end

puts duration.to_s("%h hours, %m minutes, %s seconds")

TODO: Write usage instructions here

Development

TODO: Write development instructions here

Contributing

  1. Fork it (https://github.com/jgaskins/time-span-format/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

Contributors

About

Format Crystal's `Time::Span` like `Time`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages