Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a gem to round time to nearest 15 min
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.md
Rakefile
graceful_rounding.gemspec

README.md

Graceful Rounding

A simple gem to round to the nearest 15 minutes inside a grace period.

Adds a method to Time class. Rounds Time object using (@time.min) minutes within a grace period (+/- 7 min of the quarter hour)

Monkey Patch or Ruby Mixin - it might be close

Tested under:

  • Ruby 1.9.2p136 tested

Example usage

@t = Time.new(2011,03,26,19,06,0, "-04:00")
@t.graceful_rounding #=> 2011,03,26,19,00,0, "-04:00"

Chase Southard 2011 released under the same terms as Ruby itself

Something went wrong with that request. Please try again.