Changeset 1959
- Timestamp:
- 07/31/05 09:16:21 (4 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/time/calculations.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_ext_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r1881 r1959 1 1 *SVN* 2 3 * Fixed that Time#midnight would have a non-zero usec on some platforms #1836 2 4 3 5 * Fixed inflections of "index/indices" #1766 [damn_pepe@gmail.com] trunk/activesupport/lib/active_support/core_ext/time/calculations.rb
r1431 r1959 102 102 # Returns a new Time representing the start of the day (0:00) 103 103 def beginning_of_day 104 self - self.seconds_since_midnight104 (self - self.seconds_since_midnight).change(:usec => 0) 105 105 end 106 106 alias :midnight :beginning_of_day trunk/activesupport/test/core_ext/time_ext_test.rb
r1431 r1959 131 131 assert_equal Time.local(2005, 2, 21, 17, 44, 30), Time.local(2005, 2, 21, 17, 44, 30).to_time 132 132 end 133 134 # NOTE: this test seems to fail (changeset 1958) only on certain platforms, 135 # like OSX, and FreeBSD 5.4. 136 def test_fp_inaccuracy_ticket_1836 137 midnight = Time.local(2005, 2, 21, 0, 0, 0) 138 assert_equal midnight.midnight, (midnight + 1.hour + 0.000001).midnight 139 end 133 140 end