aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer/time.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* Add duration constructors for use in Numeric extensionsAndrew White2017-01-121-2/+2
| | | | | The Numeric extensions like 1.day, 1.month, etc. shouldn't know how the internals of ActiveSupport::Duration works.
* Fix inconsistent results when parsing large durations and constructing ↵Andrey Novikov2017-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | durations from code ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true Duration parsing made independent from any moment of time: Fixed length in seconds is assigned to each duration part during parsing. Changed duration of months and years in seconds to more accurate and logical: 1. The value of 365.2425 days in Gregorian year is more accurate as it accounts for every 400th non-leap year. 2. Month's length is bound to year's duration, which makes sensible comparisons like `12.months == 1.year` to be `true` and nonsensical ones like `30.days == 1.month` to be `false`. Calculations on times and dates with durations shouldn't be affected as duration's numeric value isn't used in calculations, only parts are used. Methods on `Numeric` like `2.days` now use these predefined durations to avoid duplicating of duration constants through the codebase and eliminate creation of intermediate durations.
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Change Integer#year to return a Fixnum instead of a Float to improve consistencyKonstantinos Rousis2015-10-221-1/+1
|
* Remove reference to Numeric#from_now, as it is no longer supportednerdinand2015-03-231-15/+0
|
* Add missing requires to core_ext/integer/timePablo Torres2012-12-161-0/+3
|
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-121-9/+11
|
* update stdlib doc urls in comments - ↵Trevor Wennblom2012-04-071-3/+3
| | | | | | active_support/core_ext/[integer|numeric]/time.rb http://stdlib.rubyonrails.org/ last updated in 2005
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* Convert Integer time extension module to class reopenJeremy Kemper2009-03-281-42/+36
|
* Deprecated Float#years and Float#months, moved Numeric#years and ↵Tom Lea2008-10-131-0/+45
Numeric#months into Integer.