aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of 'Object#send!'. It was originally added because it's in Ruby 1.9, ↵Jeremy Kemper2008-08-311-1/+1
| | | | | | | | | | but it has since been removed from 1.9. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> Conflicts: actionpack/test/controller/layout_test.rb
* Merge with docrails.Pratik Naik2008-07-161-1/+13
|
* Fix TimeWithZone unmarshaling: coerce unmarshaled Time instances to utc, ↵gbuesing2008-07-141-1/+1
| | | | because Ruby's marshaling of Time instances doesn't respect the zone
* TimeWithZone#advance: treat :weeks option as variable-lengthgbuesing2008-06-291-2/+2
|
* TimeWithZone: when crossing DST boundary, treat Durations of days, months or ↵gbuesing2008-06-291-12/+33
| | | | years as variable-length, and all other values as absolute length. A time + 24.hours will advance exactly 24 hours, but a time + 1.day will advance 23-25 hours, depending on the day. Ensure consistent behavior across all advancing methods.
* Ruby 1.8.7 compat: TimeWithZone# and Chars#respond_to? pass along the ↵Jeremy Kemper2008-05-311-4/+4
| | | | include_private argument
* Merge docrails.Pratik Naik2008-05-251-17/+17
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Adding documentation for time zone featuresgbuesing2008-05-181-1/+28
|
* TimeWithZone #+ and #- : ensure overflow to DateTime with Numeric arggbuesing2008-05-181-2/+2
|
* Include time zone offset in TimeWithZone#to_jsonDaniel Morrison2008-05-131-1/+1
|
* TimeWithZone: date part getter methods (#year #mon #day etc) are defined on ↵gbuesing2008-05-081-0/+8
| | | | class; no longer relying on method_missing
* Improve documentation coverage and markupXavier Noria2008-05-021-6/+7
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Refactor TimeWithZone: don't send #since, #ago, #+, #-, #advance through ↵gbuesing2008-04-121-9/+18
| | | | method_missing
* TimeWithZone respects config.active_support.use_standard_json_time_formatgbuesing2008-04-121-1/+5
|
* TimeWithZone#method_missing: send to utc to advance with dst correctness, ↵Geoff Buesing2008-04-021-18/+7
| | | | | | otherwise send to time. Adding tests for time calculations methods git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9208 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Bundling abbreviated version of TZInfo gem 0.3.8: only the classes and zone ↵Geoff Buesing2008-03-301-0/+1
| | | | | | definitions required to support Rails time zone features are included. If a recent version of the full TZInfo gem is installed, this will take precedence over the bundled version git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* config.time_zone and TimeWithZone#marshal_load accept tzinfo/Olson identifiersGeoff Buesing2008-03-281-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone time conversions don't need to be wrapped in TimeOrDateTime, ↵Geoff Buesing2008-03-281-12/+2
| | | | | | because TZInfo does this internally git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone#usec returns 0 instead of error when DateTime is wrappedGeoff Buesing2008-03-281-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9105 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that TimeWithZone#to_yaml works when passed a YAML::Emitter. [rick]Rick Olson2008-03-231-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9081 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure correct TimeWithZone#to_dateGeoff Buesing2008-03-221-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9079 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make TimeWithZone work with tzinfo 0.2.x: use ↵Geoff Buesing2008-03-211-1/+1
| | | | | | TZInfo::Timezone#zone_identifier alias for #abbreviation, silence warnings on tests. Raise LoadError when TZInfo version is < 0.2 by sniffing for TZInfo::TimeOrDateTime constant. Move all tzinfo-dependent TimeZone tests into uses_tzinfo block git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9071 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time, DateTime and TimeWithZone #in_time_zone defaults to Time.zone. ↵Geoff Buesing2008-03-171-7/+2
| | | | | | Removing now unneeded #in_current_time_zone. ActiveRecord time zone aware attributes updated to use #in_time_zone git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeZone#parseGeoff Buesing2008-03-171-7/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9045 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeZone#at and DateTime#to_fGeoff Buesing2008-03-171-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9042 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone responds to Ruby 1.9 weekday-named query methodsGeoff Buesing2008-03-171-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9041 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone caches TZInfo::TimezonePeriod used for time conversion so that ↵Geoff Buesing2008-03-171-8/+26
| | | | | | it can be reused, and enforces DST rules correctly when instance is created from a local time git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9040 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removing unneeded #change_time_zone method from Time, DateTime and TimeWithZoneGeoff Buesing2008-03-111-5/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9008 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone instances correctly enforce DST rules. Adding ↵Geoff Buesing2008-03-111-14/+12
| | | | | | TimeZone#period_for_utc git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9006 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeWithZone #marshal_dump and #marshal_loadGeoff Buesing2008-03-031-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeWithZone#between?Geoff Buesing2008-02-171-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone #+ and #- behave consistently with numeric arguments regardless ↵Geoff Buesing2008-02-161-2/+15
| | | | | | of whether wrapped time is a Time or DateTime; consistenty answers false to #acts_like?(:date) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8884 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeWithZone #to_yaml, #to_datetime, #eql? and method aliases for ↵Geoff Buesing2008-02-101-0/+23
| | | | | | duck-typing compatibility with Time git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8854 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone #in_time_zone returns +self+ if zone argument is the same as ↵Geoff Buesing2008-02-101-0/+1
| | | | | | #time_zone git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding TimeWithZone #to_a, #to_f, #to_i, #httpdate, #rfc2822Geoff Buesing2008-02-101-1/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8852 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pruning unneeded TimeWithZone#change_time_zone_to_currentGeoff Buesing2008-02-101-5/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8851 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeWithZone#- added, so that #- can handle a Time or TimeWithZone argument ↵Geoff Buesing2008-01-261-0/+6
| | | | | | correctly git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8732 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding UTC zone to TimeZone; TimeWithZone no longer has to fake UTC zone ↵Geoff Buesing2008-01-251-8/+7
| | | | | | 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-1/+0
| | | | | | #<=> 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
* Introduce ActiveSupport::TimeWithZone, for wrapping Time instances with a ↵Geoff Buesing2008-01-231-0/+156
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