This project is archived and is in readonly mode.
1.5.days.ago != 36.hours.ago
Reported by Tom Lea | September 4th, 2008 @ 05:53 PM
1.5.days.ago != 36.hours.ago in 2.1... this worked in 1.2.3, and was a little surprising when migrating an exiting site.
I've attached a patch to fix this, by waterfalling the fractional weeks and days down to hours.
This does not change the way months and years behave, but it may be worth looking a being a little more grumpy about calling .years or .months on a float... but I digress...
Patch attached, as always, feedback/comments/+1s all welcome.
Comments and changes to this ticket
-
Tom Lea September 11th, 2008 @ 04:46 PM
- Tag changed from activesupport, core_ext, patch to activesupport, bug, core_ext, patch
Updated the patch with input from rails-core.
Deprecated Float#years and Float#months.
-
Michael Koziarski September 11th, 2008 @ 05:04 PM
- Milestone cleared.
- Assigned user set to Geoff Buesing
-
Geoff Buesing September 15th, 2008 @ 01:03 AM
Failing test with this latest patch :/
1) Error: test_deprecated_fractional_months(DurationTest): ArgumentError: wrong number of arguments (3 for 2)
-
Tom Lea September 16th, 2008 @ 09:22 AM
Gah!
It seems something I was toying with (and clearly did not have time to get finished) slipped into a commit.
Updated patch attached to finish what I was toying with... feel free to squash the commits down if you prefer.
-
Repository October 14th, 2008 @ 02:27 AM
- State changed from new to resolved
(from [27c70ff386e76ed0af41b53f2ba8cdb09bc94ace]) Time#advance recognizes fractional days and weeks [#970 state:resolved] http://github.com/rails/rails/co...
-
Tom Lea October 14th, 2008 @ 05:34 PM
- Tag changed from activesupport, bug, core_ext, patch to activesupport, bug, core_ext, patch
Thanks for the commit Geoff.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 970 1.5.days.ago != 36.hours.ago (from [27c70ff386e76ed0af41b53f2ba8cdb09bc94ace]) Time#ad...