aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_time_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #4284 from mattdbridges/time_calculation_aliasesXavier Noria2012-02-281-0/+16
|\ | | | | 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/+16
| | | | | | | | core extensions
* | Deprecate DateTime.local_offsetbrainopia2012-01-251-11/+2
|/
* use AS::TestCase as the base classAaron Patterson2012-01-051-1/+1
|
* beginning_of_week extended in both Time and Date so that to return week ↵gregolsen2011-11-251-0/+18
| | | | start based on start day that is monday by default
* Removed argument throwing warnings when running tests.Henrik Hodne2011-11-061-3/+3
| | | | | | | | The last argument to DateTime.new/civil is the Julian day number for when the calendar reform occured. DateTime ignores it if it's 0, and sets it to the default of DateTime::ITALY instead, so we could just leave it out. This also removes the warnings while running the ActiveSupport tests (there still are some for the setup though).
* updated Time, Date and DateTime current methods in AS to use Time.zone and ↵Josh Kalderimis2011-02-281-4/+4
| | | | | | not Time.zone_default. [#6410 state:committed]
* Preserve fractional seconds in DateTime#to_timeJohn Firebaugh2011-02-031-0/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* implements weeks_ago and prev_week for Date/DateTime/Time [#5122 ↵Rob Zolkos & Xavier Noria2010-10-161-0/+16
| | | | state:committed]
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* adds test coverage to ensure DateTime#advance processes first the date ↵Xavier Noria2010-08-051-12/+19
| | | | deltas, and then the time deltas
* fix conditions when DateTime#to_date and DateTime#xmlschema methods are definedRaimonds Simanovskis2010-06-041-2/+2
|
* Final iteration of use better testing methodsNeeraj Singh2010-05-191-2/+2
| | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* defines prev_(month|year) in Date and Time to ease transition to 1.9, and ↵Xavier Noria2010-05-121-4/+4
| | | | deprecates last_(month|year)
* let Time.time_with_datetime_fallback handle properly years in the range 0..138Xavier Noria2010-05-051-0/+5
|
* Added #to_i to DateTime in ActiveSupport so #to_yaml works correctly on ↵Serguei Filimonov2009-12-151-0/+4
| | | | ActiveRecord models with DateTime attributes.
* Consolidate date & time landscape: require 'active_support/time'Jeremy Kemper2009-11-141-1/+1
|
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+1
|
* Require mocha >= 0.9.0 for AS testsJeremy Kemper2008-11-221-58/+54
|
* Add thorough tests for Time-object #past?, #future? and #today. Fix ↵gbuesing2008-09-141-10/+62
| | | | TimeWithZone #today? to use #time instead of #utc for date comparison. Update changelog. [#720 state:resolved]
* Introduce convenience methods past?, today? and future? for Date and Time ↵Clemens Kofler2008-09-141-0/+23
| | | | classes to facilitate Date/Time comparisons.
* Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ↵Joshua Peek2008-06-031-12/+12
| | | | ActiveSupport [#238 state:resolved]
* Add #getutc alias for DateTime#utcgbuesing2008-04-121-0/+1
|
* Play nice with 1.9's DateTime#to_sJeremy Kemper2008-03-291-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeZone#at and DateTime#to_fGeoff Buesing2008-03-171-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9042 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* with_timezone test helper renamed with_env_tz, to distinguish between ↵Geoff Buesing2008-01-261-3/+3
| | | | | | setting ENV['TZ'] and setting Time.zone in tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8731 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding UTC zone to TimeZone; TimeWithZone no longer has to fake UTC zone ↵Geoff Buesing2008-01-251-3/+3
| | | | | | with nil git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8720 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time and DateTime #compare_with_coercion, which layers behavior on ↵Geoff Buesing2008-01-231-0/+18
| | | | | | #<=> 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
* Adding Time and DateTime #formatted_offset, for outputting +HH:MM utc offset ↵Geoff Buesing2008-01-231-0/+12
| | | | | | strings with cross-platform consistency git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8698 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing ↵Geoff Buesing2008-01-161-0/+22
| | | | | | compatibility with Time. Closes #10002 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8649 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* require abstract_unit directly since test is in load pathJeremy Kemper2008-01-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: normalize date and time xmlschema to match Ruby's ↵Jeremy Kemper2007-12-151-4/+3
| | | | | | formatting [chuyeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change Time and DateTime #end_of_month to return last second of month ↵Geoff Buesing2007-11-241-4/+3
| | | | | | 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/+19
| | | | | | [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/+4
| | | | 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-1/+9
| | | | | | Closes #9825. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Date#years_ago and #years_since from leap days. Closes #9864.Jeremy Kemper2007-10-131-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor Time and Date#months_since and #months_ago to use #advance. Closes ↵Jeremy Kemper2007-10-131-0/+4
| | | | | | #9863. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Some platforms include colon in timezone offset, some don't. References #9744.Jeremy Kemper2007-10-031-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Date#xmlschema for dates outside the range of what can be created with ↵David Heinemeier Hansson2007-10-011-2/+7
| | | | | | Time (closes #9744) [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed spelling errors (closes #9706) [tarmo/rmm5t]David Heinemeier Hansson2007-09-281-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Date/Time/DateTime Ruby 1.9 compatJeremy Kemper2007-09-271-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Time#advance bug when trying to advance a year from leap day. Closes ↵Rick Olson2007-08-031-0/+1
| | | | | | #8655 [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7262 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oh please. References #8646.Jeremy Kemper2007-06-141-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7021 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Maybe passing an explicit offset mollifies CIA. References #8646.Jeremy Kemper2007-06-141-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7020 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve Time and Date test coverage. Closes #8646.Jeremy Kemper2007-06-141-4/+19
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7019 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Readable Date and DateTime#inspect. Closes #8570.Jeremy Kemper2007-06-041-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DateTime#to_time converts to Time unless out of range. Date#to_datetime and ↵Jeremy Kemper2007-05-301-0/+6
| | | | | | Date#to_s(:rfc822). Closes #8512. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time durations use since instead of + for accuracy. Closes #8513.Jeremy Kemper2007-05-301-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DateTime uses Time formats. Closes #8476.Jeremy Kemper2007-05-261-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6854 5ecf4fe2-1ee6-0310-87b1-e25e094e27de