aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-5/+5
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-5/+5
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-5/+5
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Add compatibility for Ruby 2.4 `to_time` changesAndrew White2016-04-231-0/+1
| | | | | | | | | | | | | | | In Ruby 2.4 the `to_time` method for both `DateTime` and `Time` will preserve the timezone of the receiver when converting to an instance of `Time`. Since Rails 5.0 will support Ruby 2.2, 2.3 and later we need to introduce a compatibility layer so that apps that upgrade do not break. New apps will have a config initializer file that defaults to match the new Ruby 2.4 behavior going forward. For information about the changes to Ruby see: https://bugs.ruby-lang.org/issues/12189 https://bugs.ruby-lang.org/issues/12271 Fixes #24617.
* Remove unneeded Time patch to support Ruby 1.9Rafael Mendonça França2015-01-041-1/+0
|
* Squashed commit of the following:Aaron Patterson2013-05-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Added ability to compare date/time with infinitybUg2013-01-041-0/+1
| | | | | | | | | | | | | | | | | 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.
* Added time related req files to AS core_ext #6896Aaron Cruz2012-07-141-0/+5
| | | | | | This way you can `require 'active_record/core_ext/time'` for example I see these libs are available through `active_record/time` but not individually
* Consolidate date & time landscape: require 'active_support/time'Jeremy Kemper2009-11-141-10/+0
|
* Convert Time conversions extension module to class reopenJeremy Kemper2009-03-281-3/+1
|
* Tease out Object#acts_like? behaviorsJeremy Kemper2009-03-281-0/+1
|
* Convert Time extension modules to class reopensJeremy Kemper2009-03-261-1/+4
|
* Extract time fixes into separate extensionsJeremy Kemper2009-03-241-27/+2
|
* * Introduce ActiveSupport.core_ext Integer, %w(conversions time etc)Jeremy Kemper2009-03-211-11/+2
| | | | | | * Convert some extension modules to simply reopening the class * Remove deprecated Float time extensions * Fold Base64 extension into ActiveSupport::Base64 since stdlib Base64 is gone
* Handle the case where there is no ivar set.Michael Koziarski2008-09-041-1/+1
| | | | This happens on jruby due to a bug, but also on historically marshalled data.
* Fix Ruby's Time marshaling bug in pre-1.9 versions of Ruby: utc instances ↵Luca Guidi2008-08-271-1/+22
| | | | are now correctly unmarshaled with a utc zone instead of the system local zone [#900 state:resolved]
* Introduce ActiveSupport::TimeWithZone, for wrapping Time instances with a ↵Geoff Buesing2008-01-231-0/+2
| | | | | | TimeZone. Introduce instance methods to Time for creating TimeWithZone instances, and class methods for managing a global time zone git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8696 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat, consistent load pathsJeremy Kemper2007-10-021-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Active ↵Jeremy Kemper2007-02-011-0/+10
| | | | | | Support. Make it public to preserve compatibility. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6099 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Object#acts_like? and Time#acts_like_time? and Date#acts_like_date? to ↵Jamis Buck2007-01-151-0/+2
| | | | | | facilitate duck-typing git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5951 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time::Conversions for getting times in different convenient string ↵David Heinemeier Hansson2005-02-211-0/+2
| | | | | | representations and other objects git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@737 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time::Calculations to ask for things like Time.now.tomorrow, ↵David Heinemeier Hansson2005-02-211-0/+5
Time.now.yesterday, Time.now.months_ago(4) #580 [DP|Flurin] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@731 5ecf4fe2-1ee6-0310-87b1-e25e094e27de