aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ↵Joshua Peek2008-06-031-14/+14
| | | | ActiveSupport [#238 state:resolved]
* Time#since behaves correctly when passed a Duration. Closes #11527 [kemiller]gbuesing2008-04-121-2/+53
|
* Time #yesterday and #tomorrow behave correctly crossing DST boundary. Closes ↵Geoff Buesing2008-04-041-0/+52
| | | | | | #7399 [sblackstone] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* test_time_with_datetime_fallback expects DateTime.local_offset instead of ↵Geoff Buesing2008-03-101-2/+2
| | | | | | DateTime.now.offset git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9002 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time#end_of_day, _quarter, _week, and _year. Closes #9312.Jeremy Kemper2008-02-271-0/+35
| | | | 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/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Time Zone support to ActiveRecord, and config.time_zone property for ↵Rick Olson2008-02-061-0/+9
| | | | | | specifying a default Time Zone. Closes #10982 [Geoff Buesing, rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* with_timezone test helper renamed with_env_tz, to distinguish between ↵Geoff Buesing2008-01-261-24/+24
| | | | | | 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
* Time#- coerces TimeWithZone argument to a Time instance so that difference ↵Geoff Buesing2008-01-251-0/+4
| | | | | | 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
* 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
* Time.days_in_month defaults to current year if no year is supplied as ↵Geoff Buesing2008-01-251-1/+13
| | | | | | 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/+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/+15
| | | | | | strings with cross-platform consistency git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8698 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
* Fix invalid time test. Closes #10632 [Dirkjan Bussink]Jeremy Kemper2008-01-021-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8518 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Honor Ruby's default calendar reform setting when creating DateTime objects ↵Geoff Buesing2007-11-241-0/+2
| | | | | | 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-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-3/+5
| | | | | | [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-2/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7868 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Time#years_ago and #years_since from leap days. Closes #9865.Jeremy Kemper2007-10-131-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7867 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time and DateTime#advance accept :hours, :minutes, and :seconds options. ↵Jeremy Kemper2007-10-131-2/+16
| | | | | | Closes #9825. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7866 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
* 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-3/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix tests across DST (closes #9020) [mpalmer]David Heinemeier Hansson2007-09-221-5/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7557 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Time#advance bug when trying to advance a year from leap day. Closes ↵Rick Olson2007-08-031-0/+2
| | | | | | #8655 [gbuesing] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7262 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve Time and Date test coverage. Closes #8646.Jeremy Kemper2007-06-141-17/+23
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7019 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
* Date, Time, and DateTime support formatting blocks in addition to strftime ↵Jeremy Kemper2007-05-251-4/+5
| | | | | | strings. Introduce :long_ordinal format, e.g. 'February 21st, 2005'. Closes #8191. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6844 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix to_datetime test broken by DST change. Closes #7797.Jeremy Kemper2007-03-121-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6389 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#since overflows to DateTime. Introduce Time#to_datetime. Closes #7715.Jeremy Kemper2007-03-051-0/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Out-of-range Time calculations transparently overflow to DateTime. Closes #7706.Jeremy Kemper2007-03-041-0/+25
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time#to_s(:time) which will just return H:M, like 17:44 [DHH]David Heinemeier Hansson2006-11-251-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5628 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Test multiple timezones' DST. Closes #5617.Jeremy Kemper2006-11-031-17/+73
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use US timezone for DST tests. Closes #5617.Jeremy Kemper2006-11-021-23/+43
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* next_week respects DST changes. Closes #5617, closes #2353, closes #2509, ↵Jeremy Kemper2006-11-021-0/+50
| | | | | | references #4551. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* next_week respects DST changes. Closes #6483.Jeremy Kemper2006-10-241-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5363 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4487@asus: jeremy | 2006-04-29 12:21:39 -0700Jeremy Kemper2006-07-081-24/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check whether @flash is defined? for warnings-safety. r4488@asus: jeremy | 2006-04-29 12:23:15 -0700 Check whether @flash is defined? for warnings-safety. Obviates nil? check. r4489@asus: jeremy | 2006-04-29 12:45:18 -0700 Check whether @session is defined? for warnings-safety. r4490@asus: jeremy | 2006-04-29 12:50:41 -0700 Check whether @rendering_runtime is defined? for warnings-safety. r4491@asus: jeremy | 2006-04-29 12:55:01 -0700 Check whether @_cycles is defined? for warnings-safety. r4492@asus: jeremy | 2006-04-29 12:59:19 -0700 Check whether instance variables are defined? for warnings-safety. r4493@asus: jeremy | 2006-04-29 13:14:09 -0700 Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning. r4494@asus: jeremy | 2006-04-29 13:31:34 -0700 Check whether @auto_index defined? for warnings-safety. r4495@asus: jeremy | 2006-04-29 13:32:24 -0700 Wrap content_columns redefinitions with silence_warnings. r4496@asus: jeremy | 2006-04-29 13:35:28 -0700 Wrap more redefinitions with silence_warnings. r4829@asus: jeremy | 2006-07-08 10:59:20 -0700 abstract unit, fix warnings r4830@asus: jeremy | 2006-07-08 11:06:12 -0700 Use parens to silence warning. r4831@asus: jeremy | 2006-07-08 11:06:48 -0700 Use parens to silence warning. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time#advance to do precise time time calculations for cases where a ↵David Heinemeier Hansson2006-03-161-0/+14
| | | | | | month being approximated to 30 days won't do (closes #1860) [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3887 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#xmlschema is only available when you've required 'time'. Add a unit ↵Michael Koziarski2006-03-151-0/+4
| | | | | | test to catch regressions. [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3880 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time#beginning_of_quarter (closes #3607) [cohen.jeff@gmail.com]David Heinemeier Hansson2006-02-261-0/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3659 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time#end_of_month to accompany Time#beginning_of_month (closes #2514) ↵David Heinemeier Hansson2005-10-261-0/+7
| | | | | | [Jens-Christian Fischer] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2745 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Time#change should also reset usec when also resetting minutes ↵David Heinemeier Hansson2005-10-131-0/+5
| | | | | | #2459 [ikeda@dream.big.or.jp] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2568 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :rfc822 as an option for Time#to_s (to get rfc822-formatted times)Jamis Buck2005-10-031-3/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make Time#last_month work when invoked on the 31st of a month.Jamis Buck2005-08-311-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2083 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Time.days_in_month, and make Time#next_month work when invoked on the ↵Jamis Buck2005-08-311-0/+24
| | | | | | 31st of a month git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Time#midnight would have a non-zero usec on some platforms #1836Jamis Buck2005-07-311-1/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Time#at_beginning_of_week returned the next Monday instead of the ↵David Heinemeier Hansson2005-06-161-0/+7
| | | | | | previous one when called on a Sunday #1403 [jean.helou@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1431 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Time#last_year to go back in time, not forward #1278 [fabien@odilat.com]David Heinemeier Hansson2005-05-191-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1319 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Time.local(2005,12).months_since(1) would raise "ArgumentError: ↵David Heinemeier Hansson2005-05-191-0/+2
| | | | | | argument out of range" #1311 [jhahn@niveon.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1308 5ecf4fe2-1ee6-0310-87b1-e25e094e27de