aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time/calculations.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #4284 from mattdbridges/time_calculation_aliasesXavier Noria2012-02-281-0/+3
|\ | | | | Added aliases for prev_year, prev_month, and prev_week in Time and Date calculations
| * Adding :last_week, :last_month, and :last_year aliases to Time and DateMatt Bridges2012-02-211-0/+3
| | | | | | | | core extensions
* | Update Time#change docs to reflect the options it usesEric Oestrich2012-02-171-1/+1
| | | | | | [ci skip]
* | Optional start_day argument for Time#all_week.kennyj2012-02-061-3/+3
|/ | | | Closes #4883
* Nano seconds fraction of time is copied properly in Time#advancePawel Pierzchala2012-01-051-1/+1
| | | | | | When day, month or year was passed, advance created a new time ignoring previous nsec fraction. Now nsec is passed through usec as a Rational number.
* Adds Time#sunday methodVijay Dev2011-11-261-0/+6
|
* Convert aliases monday and sunday to methodsVijay Dev2011-11-261-1/+6
| | | | | | | | A recent change to beginning_of_week and end_of_week added an argument that can be used to specify the week's starting day as a symbol. Now these methods were aliased as monday and sunday respectively which as a consequence of the argument addition, made calls like obj.monday(:sunday) possible. This commit makes them methods on their own.
* API docstrings updated with default value infogregolsen2011-11-251-3/+3
|
* beginning_of_week extended in both Time and Date so that to return week ↵gregolsen2011-11-251-8/+16
| | | | start based on start day that is monday by default
* Merge pull request #3725 from marcandre/twz_eqlYehuda Katz2011-11-221-0/+10
|\ | | | | Fix inconsistencies with Time{WithZone}#{hash,eql?}
| * Fix inconsistencies with Time{WithZone}#{hash,eql?}Marc-Andre Lafortune2011-11-221-0/+10
| |
* | updating API docstring so that user can infer default valuegregolsen2011-11-171-2/+2
|/
* Edited activesupport/lib/active_support/core_ext/time/calculations.rb via GitHubJeremy Evans2011-09-011-1/+1
|
* Fix AR test suite error under Rubinius 2.0Guillermo Iguaran2011-08-051-0/+1
|
* Rename Time#whole_* to Time#all_* [thanks Pratik!]David Heinemeier Hansson2011-06-131-5/+5
|
* Added Time#whole_day/week/quarter/year as a way of generating ranges ↵David Heinemeier Hansson2011-06-131-1/+26
| | | | (example: Event.where(created_at: Time.now.whole_week)) [DHH]
* add some missing requires for AS core_ext/numeric/time. Closes #1038Josh Kalderimis2011-05-181-0/+1
|
* Removed some redundant Time#change time options from beginning_of_ methods ↵Chris Kalafarski2011-03-131-3/+3
| | | | in Date and Time
* refactored Time#<=> and DateTime#<=> by removing unnecessary calls without ↵Diego Carrion2011-03-041-11/+2
| | | | | | losing performance Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* updated Time, Date and DateTime current methods in AS to use Time.zone and ↵Josh Kalderimis2011-02-281-2/+2
| | | | | | not Time.zone_default. [#6410 state:committed]
* implements weeks_ago and prev_week for Date/DateTime/Time [#5122 ↵Rob Zolkos & Xavier Noria2010-10-161-1/+11
| | | | state:committed]
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* Refactor move some date, time and date_time methods to */zones and fixed ↵Santiago Pastorino2010-07-031-0/+5
| | | | some requires
* removes deprecations of last_(month|year) from master, they will be ↵Xavier Noria2010-05-191-11/+0
| | | | deprecated in 2.3 instead
* defines prev_(month|year) in Date and Time to ease transition to 1.9, and ↵Xavier Noria2010-05-121-2/+12
| | | | deprecates last_(month|year)
* let Time.time_with_datetime_fallback handle properly years in the range 0..138Xavier Noria2010-05-051-3/+5
|
* Time#- with a DateTime argument behaves the same as with a Time argument, ↵Geoff Buesing2010-01-271-1/+1
| | | | i.e. returns the difference between self and arg as a Float [#3476 status:resolved]
* Missing acts_like dependencyYehuda Katz2009-12-201-0/+1
|
* Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a FloatJeremy Kemper2009-08-221-1/+2
|
* Setting usec (and nsec for Ruby 1.9) on Time#end_of_* methods [#1255 ↵Hugo Peixoto2009-08-091-8/+8
| | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge branch 'master' into cherryJeremy Kemper2009-04-201-11/+3
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: activesupport/CHANGELOG activesupport/lib/active_support/core_ext/class/delegating_attributes.rb activesupport/lib/active_support/core_ext/hash/conversions.rb activesupport/lib/active_support/core_ext/module/attribute_accessors.rb activesupport/lib/active_support/core_ext/string/multibyte.rb activesupport/lib/active_support/core_ext/time/calculations.rb activesupport/lib/active_support/deprecation.rb
| * Time.local instances: Adding 24.hours across the DST boundary adds 24 hours ↵Michael Curtis2009-03-291-11/+3
| | | | | | | | instead of one day [#2066 state:resolved]
* | Explicit dependency on Date calculations extensionsJeremy Kemper2009-03-281-0/+1
| |
* | Convert Time extension modules to class reopensJeremy Kemper2009-03-261-298/+281
|/
* Explicitly require AS::DurationJeremy Kemper2008-11-171-0/+2
|
* Time#advance recognizes fractional days and weeks [#970 state:resolved]Tom Lea2008-10-131-0/+10
|
* Fixed Time#end_of_quarter to not blow up on May 31st [#313 state:resolved]Carlos Brando2008-09-191-1/+1
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Introduce convenience methods past?, today? and future? for Date and Time ↵Clemens Kofler2008-09-141-10/+25
| | | | classes to facilitate Date/Time comparisons.
* Merge with docrails.Pratik Naik2008-07-161-1/+1
|
* Improve documentation coverage and markupXavier Noria2008-05-021-4/+6
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Time#since behaves correctly when passed a Duration. Closes #11527 [kemiller]gbuesing2008-04-121-5/+8
|
* Time #yesterday and #tomorrow behave correctly crossing DST boundary. Closes ↵Geoff Buesing2008-04-041-2/+2
| | | | | | #7399 [sblackstone] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time#end_of_day, _quarter, _week, and _year. Closes #9312.Jeremy Kemper2008-02-271-0/+19
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8934 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time.=== returns true for TimeWithZone instancesGeoff Buesing2008-02-161-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#- coerces TimeWithZone argument to a Time instance so that difference ↵Geoff Buesing2008-01-251-0/+11
| | | | | | in seconds can be calculated. Closes #10914 [Geoff Buesing, yyyc514] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8730 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time.days_in_month defaults to current year if no year is supplied as ↵Geoff Buesing2008-01-251-12/+7
| | | | | | argument, uses Date.gregorian_leap? to determine leap year, and uses constant lookup to determine days in month. Closes #10799 [Radar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8715 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time and DateTime #compare_with_coercion, which layers behavior on ↵Geoff Buesing2008-01-231-0/+17
| | | | | | #<=> so that any combination of Time, DateTime and ActiveSupport::TimeWithZone instances can be chronologically compared git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8711 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Honor Ruby's default calendar reform setting when creating DateTime objects ↵Geoff Buesing2007-11-241-1/+1
| | | | | | via ActiveRecord's Time -> DateTime overflow, Time#time_with_datetime_fallback, Time#to_datetime, Date#to_datetime and String#to_datetime. Closes #10201 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change Time and DateTime #end_of_month to return last second of month ↵Geoff Buesing2007-11-241-1/+1
| | | | | | instead of beginning of last day of month. Closes #10200 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8198 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cater for DST changes when converting Times to DateTimes. Closes #10068 ↵Michael Koziarski2007-11-051-1/+1
| | | | | | [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8076 5ecf4fe2-1ee6-0310-87b1-e25e094e27de