rails/rails — pull request #7029 by panthomakos (2012-07-11 00:16:33+00:00)
Title: Refactored common date and time calculations.

* Added the `DateAndTime::Calculations` module that is included in `Time` and `Date`. It houses common calculations to reduce duplicated code.
* Simplified and cleaned-up the calculation code.
* Removed duplication in tests by adding a behavior module for shared tests. I also added some missing tests.