aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/date_time/calculations.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #12080 from ShayDavidson/fix_datetime_partial_datesMatthew Draper2014-05-281-1/+11
|\ | | | | | | Added partial days support to `DateTime`'s `advance` method.
| * Added partial days support to `DateTime`'s `advance` method.Shay Davidson2013-08-301-5/+15
| | | | | | | | | | You can now add partial days (e.g. 2.5.days) to `DateTime` with the advance method. This was acheived by mimicing the `advance` implementation in `Time`.
* | Check `respond_to` before delegation due to: ↵Aaron Patterson2014-01-091-1/+5
|/ | | | https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314
* Remove duplication from date_time calculationsGilad Zohari2013-07-311-10/+0
| | | | | | Methods: :past? and :future? are already defined identically in date_and_time/calculations.rb which is included in Date. Because DateTime is a subclass of Date, it can call them.
* Merge pull request #10879 from makaroni4/masterAndrew White2013-07-291-0/+10
|\ | | | | Added Time#middle_of_day method
| * Added Time#middle_of_dayAnatoli Makarevich2013-07-281-0/+10
| | | | | | | | Added middle_of_day method to Date and DateTime
* | Removed unsued deprecation requireRashmi Yadav2013-07-041-1/+0
| |
* | Remove deprecated `DateTime.local_offset`Arun Agrawal2013-07-031-7/+0
|/
* Squashed commit of the following:Aaron Patterson2013-05-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 2683de5da85135e8d9fe48593ff6167db9d64b18 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:29:20 2013 -0700 cannot support infinite ranges right now commit cebb6acef2c3957f975f6db4afd849e535126253 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:26:12 2013 -0700 reverting infinity comparison commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:23:28 2013 -0700 Revert "Added ability to compare date/time with infinity" This reverts commit 38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb activesupport/test/core_ext/date_ext_test.rb activesupport/test/core_ext/date_time_ext_test.rb activesupport/test/core_ext/numeric_ext_test.rb activesupport/test/core_ext/time_ext_test.rb activesupport/test/core_ext/time_with_zone_test.rb commit 0d799a188dc12b18267fc8421675729917610047 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:18:53 2013 -0700 Revert "Refactor infinite comparable definition a bit" This reverts commit dd3360e05e4909f2f0c74a624cccc2def688f828. commit 42dec90e49745bbfae546f0560b8783f6b48b074 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:18:47 2013 -0700 Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module" This reverts commit 7003e71c13c53ec3d34250560fbf80b8381df693.
* Fixes Dependency bug in Active SupportTomohiko Himura2013-05-021-0/+1
| | | | DateTime defined in date.rb
* Keep second fraction when DateTime#change is called.Chris Baynes2013-02-251-1/+1
|
* Correct comment for (beginning|end)_of_minuteGert Goet2013-02-221-2/+2
|
* Added beginning_of_minute support to core_ext calculations for Time and DateTimeGagan Awhad2013-02-211-0/+12
|
* Clarified the minute option on DateTime#changeJakob Waller2013-01-101-1/+1
|
* Added ability to compare date/time with infinitybUg2013-01-041-7/+0
| | | | | | | | | | | | | | | | | Date, DateTime, Time and TimeWithZone can now be compared to infinity, so it's now possible to create ranges with one infinite bound and date/time object as another bound. Ex.: @range = Range.new(Date.today, Float::INFINITY) Also it's possible to check inclusion of date/time in range with conversion. Ex.: @range.include?(Time.now + 1.year) # => true @range.include?(DateTime.now + 1.year) # => true Ability to create date/time ranges with infinite bound is required for handling postgresql range types.
* Add missing at_end_of_* aliasesAndrew White2012-12-111-0/+2
|
* Add #seconds_until_end_of_day to DateTime and TimeOlek Janiszewski2012-11-291-0/+9
|
* Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-1/+1
|
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-121-24/+31
|
* Expand documentation for change() method in Time, Date, and DateTimeJeff Shantz2012-08-291-2/+7
|
* removing unnecessary 'examples' noise from activesupportFrancesco Rodriguez2012-05-131-2/+0
|
* added beginning_of_hour support to core_ext calculations for Time and DateTimeMark J. Titorenko2012-05-041-0/+11
|
* AS core_ext refactoringAlexey Gaziev2012-04-291-12/+21
|
* Deprecate DateTime.local_offsetbrainopia2012-01-251-1/+5
|
* Update time zone offset informationbrainopia2012-01-181-1/+1
|
* revert "fixing some tests on ruby 1.9.3 SHA 33f222b"Vishnu Atrai2012-01-071-23/+0
|
* Initial pass at removing dead 1.8.x code from Active Support.José Valim2011-12-201-2/+0
| | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
* fixing some tests on ruby 1.9.3Aaron Patterson2011-03-071-0/+23
|
* refactored Time#<=> and DateTime#<=> by removing unnecessary calls without ↵Diego Carrion2011-03-041-8/+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-1/+2
| | | | | | not Time.zone_default. [#6410 state:committed]
* Refactor move some date, time and date_time methods to */zones and fixed ↵Santiago Pastorino2010-07-031-0/+1
| | | | some requires
* date_time/calculations.rb needs active_support/core_ext/object/acts_like ↵Xavier Noria2010-01-011-0/+1
| | | | because it uses acts_like?
* Ruby 1.9.2: rational.rb is deprecatedJeremy Kemper2009-11-021-1/+1
|
* Convert DateTime extension modules to class reopensJeremy Kemper2009-03-261-108/+94
|
* Introduce convenience methods past?, today? and future? for Date and Time ↵Clemens Kofler2008-09-141-5/+19
| | | | classes to facilitate Date/Time comparisons.
* Improve documentation coverage and markupXavier Noria2008-05-021-2/+4
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add #getutc alias for DateTime#utcgbuesing2008-04-121-0/+1
|
* Adding Time and DateTime #compare_with_coercion, which layers behavior on ↵Geoff Buesing2008-01-231-0/+12
| | | | | | #<=> 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
* Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing ↵Geoff Buesing2008-01-161-0/+20
| | | | | | compatibility with Time. Closes #10002 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8649 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cater for DST changes when converting Times to DateTimes. Closes #10068 ↵Michael Koziarski2007-11-051-0/+10
| | | | | | [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8076 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time, Date and DateTime #advance accept :weeks option. Closes #9866.Jeremy Kemper2007-10-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7868 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time and DateTime#advance accept :hours, :minutes, and :seconds options. ↵Jeremy Kemper2007-10-131-2/+4
| | | | | | Closes #9825. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: remove deprecated :mday option from Time, Date, and ↵Jeremy Kemper2007-09-181-1/+1
| | | | | | DateTime#change. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7508 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Time#advance bug when trying to advance a year from leap day. Closes ↵Rick Olson2007-08-031-3/+1
| | | | | | #8655 [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7262 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move common DateTime calculations to Date. Closes #8536.Jeremy Kemper2007-06-011-119/+13
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6921 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time durations use since instead of + for accuracy. Closes #8513.Jeremy Kemper2007-05-301-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DateTime calculations analogous to the Date and Time extensions. Closes #7693.Jeremy Kemper2007-03-041-0/+173
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6303 5ecf4fe2-1ee6-0310-87b1-e25e094e27de