0.0
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
Round time using logic and not complex math.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 5.9.1, ~> 5.9.1
~> 10.0
~> 0.2.10
 Project Readme

TimeRounder

TimeRounder is a gem born to solve a problem, which is to round time, without all the complex math. TimeRounder defeats all the complex math used to round time, by using logic.

Note: Support for Ruby 1.9.3 & 2.0.x has been dropped.

Installation

Add this line to your application's Gemfile:

gem 'time_rounder'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install time_rounder

Usage

TimeRounder has simple methods to access internal classes that calculate the total hours to the nearest quarter hours in a given number of seconds.

TimeRounder.seconds_to_hours(seconds) #seconds is the total seconds to be rounded into quarter hours

TimeRounder can also take a DateTime/Time object and round it to the nearest quarter hour

TimeRounder.rounded_time(date) #date is DateTime/Time object

Development

TimeRounder will continue to be developed adding features and functionality. Some of those features currently planned are:

  • Adding 5, 10, 20 minute rounding schedules.
  • Adding rounding of a date/time object.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rebelweb/time_rounder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.