aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time
Commit message (Collapse)AuthorAgeFilesLines
* 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/+15
|
* Revert some warning removals related to Ruby 2.0Carlos Antonio da Silva2013-01-071-2/+0
| | | | | | | | | | | | | | | | | | These warnings were actually a bug in Ruby 2.0, the accessors should not be raising such warnings, they are only meant for ivars. - Revert "fix warnings in Ruby 2.0" This reverts commit 26702a6d3461f4a1c75165030b96886514ecb877. - Revert "Merge pull request #8282 from arunagw/warning_removed_for_ruby2" This reverts commit f63d6544e45e78cda29c0c56fbdf3d9e1f405340, reversing changes made to 3a890681fad8218305585036abed6d7463a44e41.
* Added ability to compare date/time with infinitybUg2013-01-041-0/+5
| | | | | | | | | | | | | | | | | 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.
* Deprecate obsolete Time to DateTime fallback methodsAndrew White2012-12-111-0/+10
| | | | | | | The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time methods were added to handle the limitations of Ruby's native Time implementation. Those limitations no longer apply so we are deprecating them in 4.0 and they will be removed in 4.1.
* Add missing at_end_of_* aliasesAndrew White2012-12-111-0/+2
|
* Use send in Time marshal extensions since the methods are now privateCarlos Antonio da Silva2012-12-031-1/+1
| | | | | | | See https://github.com/ruby/ruby/commit/9c1b3161f20162dc1682d758c0e4d2fc3a74745e All Active Support tests pass in 2.0.0preview2 after this change. Closes #8409
* Add #seconds_until_end_of_day to DateTime and TimeOlek Janiszewski2012-11-291-0/+9
|
* fix warnings in Ruby 2.0Aaron Patterson2012-11-071-0/+2
|
* Hash Syntax changes to 1.9 formatAvnerCohen2012-10-201-1/+1
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-213-22/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/configurable.rb activesupport/lib/active_support/core_ext/module/deprecation.rb guides/source/action_controller_overview.md guides/source/active_support_core_extensions.md guides/source/ajax_on_rails.textile guides/source/association_basics.textile guides/source/upgrading_ruby_on_rails.md While resolving conflicts, I have chosen to ignore changes done in docrails at some places - these will be most likely 1.9 hash syntax changes.
| * update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-122-15/+15
| |
| * update some AS code examples to 1.9 hash syntax [ci skip]Francesco Rodriguez2012-09-121-7/+10
| |
* | Date.beginning_of_week thread local and beginning_of_week application config ↵gregolsen2012-09-181-2/+3
|/ | | | option added (default is Monday)
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-011-2/+7
|\
| * Expand documentation for change() method in Time, Date, and DateTimeJeff Shantz2012-08-291-2/+7
| |
* | Refactored common date and time calculations.Pan Thomakos2012-08-041-198/+3
|/ | | | | | | | * Added the `DateAndTime::Calculations` module that is included in Time and Date. It houses common calculations to reduce duplicated code. * Simplified and cleaned-up the calculation code. * Removed duplication in tests by adding a behavior module for shared tests. I also added some missing tests.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-07-151-5/+5
|\
| * use 'use_zone' method in example, instead of reimplementing itJakub Kuźma2012-07-101-5/+5
| |
* | adds a missing require [fixes #6896]Xavier Noria2012-07-152-1/+1
|/ | | | | This file uses Time.zone, which is defined in active_support/core_ext/time/zones.rb.
* Make Time#change work with offsets other than UTC or localAndrew White2012-07-011-10/+15
| | | | | Use Time.new to create times where the current offset is not zero or not in the local time zone - closes #4847 and #6651.
* Add missing require.Rhett Sutphin2012-06-251-0/+1
| | | | | | | | If you selectively require core_exts (e.g., require 'active_support/core_ext/string'), it is possible for 'active_support/core_ext/time/calculations' to be required when `ActiveSupport::TimeWithZone` is not available. If this happens, the next call to Time.=== will fail with a NameError.
* Add prev_quarter and next_quarter method in Time/Date/DateTimeparanoiase Kang2012-06-201-0/+11
|
* Merge pull request #6376 from jgaskins/timestamp-microsecondsJeremy Kemper2012-05-181-0/+1
|\ | | | | Increase numeric-timestamp precision to nanoseconds
| * Increase `AR#cache_key` precision to nanosecondsJamie Gaskins2012-05-191-0/+1
| |
* | respect nsec in TimeWithZoneVasiliy Ermolovich + Sergey Nartimov2012-05-181-4/+4
|/ | | | | | | | | | | when we pass fractional usec to Time methods we should use Rational instead of Float because of accuracy problem Time.local(2011,6,12,23,59,59,999999.999).nsec # => 999999998 Time.local(2011,6,12,23,59,59,Rational(999999999, 1000)).nsec # => 999999999
* added beginning_of_hour support to core_ext calculations for Time and DateTimeMark J. Titorenko2012-05-041-0/+15
|
* String quotes and trailing spacesAlexey Gaziev2012-04-291-6/+6
|
* AS core_ext refactoring pt.2Alexey Gaziev2012-04-291-2/+5
|
* AS core_ext refactoringAlexey Gaziev2012-04-293-32/+101
|
* Remove circular require of time/zonesOscar Del Ben2012-04-211-1/+0
|
* Require for time_with_zone should stay in core_ext/time_zones :bomb:Piotr Sarnacki2012-04-151-0/+1
|
* Add missing require in Active Support time zones (fixes #5854)Piotr Sarnacki2012-04-151-1/+1
| | | | | I also removed the other require as it's already present in `activesupport/core_ext/time/calculations`
* 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
* | to_date, to_time, and to_datetime Time methods present in ruby 1.9Sergey Nartimov2012-01-131-28/+0
|/
* 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.
* remove Time._dump and Time._load patching for ruby 1.8Vasiliy Ermolovich2011-12-251-27/+0
|
* no more need to make Time#to_date and Time#to_datetime publicSergey Nartimov2011-12-222-11/+0
| | | | they are public in actual 1.9 ruby version (tested at least in 1.9.2-p180)
* 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
|
* Revert "Ruby 1.8.7+ provides to_date/to_datetime, AS just makes them ↵Chris Griego2011-08-311-0/+22
| | | | | | | | public." to support date implementations without private to_date/to_datetime on Time (home_run). This reverts commit 080345baca1076a9788dff4803153600aec31f86. Signed-off-by: José Valim <jose.valim@gmail.com>