Changeset 9105
- Timestamp:
- 03/28/08 01:57:41 (3 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/time_with_zone.rb (modified) (2 diffs)
- trunk/activesupport/test/core_ext/time_with_zone_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r9093 r9105 1 1 *SVN* 2 3 * TimeWithZone#usec returns 0 instead of error when DateTime is wrapped [Geoff Buesing] 2 4 3 5 * Improve documentation. [Radar, Jan De Poorter, chuyeow, xaviershay, danger, miloops, Xavier Noria, Sunny Ripert] trunk/activesupport/lib/active_support/time_with_zone.rb
r9081 r9105 144 144 end 145 145 146 %w(asctime day hour min mon sec usecwday yday year to_date).each do |name|146 %w(asctime day hour min mon sec wday yday year to_date).each do |name| 147 147 define_method(name) do 148 148 time.__send__(name) … … 152 152 alias_method :mday, :day 153 153 alias_method :month, :mon 154 155 def usec 156 time.respond_to?(:usec) ? time.usec : 0 157 end 154 158 155 159 %w(sunday? monday? tuesday? wednesday? thursday? friday? saturday?).each do |name| trunk/activesupport/test/core_ext/time_with_zone_test.rb
r9081 r9105 327 327 end 328 328 329 def test_usec_returns_0_when_datetime_is_wrapped 330 silence_warnings do # silence warnings raised by tzinfo gem 331 twz = ActiveSupport::TimeWithZone.new(DateTime.civil(2000), @time_zone) 332 assert_equal 0, twz.usec 333 end 334 end 335 329 336 def test_utc_to_local_conversion_saves_period_in_instance_variable 330 337 silence_warnings do # silence warnings raised by tzinfo gem