diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-17 12:05:43 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-17 12:05:43 +0000 |
commit | 49622de368339b214b3267045f68c3f4bae7e4f8 (patch) | |
tree | 5d1264a7bb74f0f79d9ad5f38e53acb0b45841e0 /lib/date/format.rb | |
parent | 85e6dff16563ae2233c8d1c162a441dc386a56c4 (diff) | |
download | ruby-49622de368339b214b3267045f68c3f4bae7e4f8.tar.gz |
* lib/date.rb (Date::Infinity#<=>): didn't work. A patch from
Dirkjan Bussink <d.bussink AT gmail.com> [ruby-core:15098].
This is a bug obviously. However it didn't affect the library's
functions.
* lib/date.rb, lib/date/format.rb: some trivial changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date/format.rb')
-rw-r--r-- | lib/date/format.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb index 67d58d465e..ff09fa8e56 100644 --- a/lib/date/format.rb +++ b/lib/date/format.rb @@ -1,5 +1,5 @@ # format.rb: Written by Tadayoshi Funaba 1999-2008 -# $Id: format.rb,v 2.42 2008-01-12 10:54:29+09 tadf Exp $ +# $Id: format.rb,v 2.43 2008-01-17 20:16:31+09 tadf Exp $ require 'rational' @@ -257,12 +257,12 @@ class Date when 'j'; emit_n(yday, 3, f) when 'k'; emit_a(hour, 2, f) when 'L' - emit_n((sec_fraction / MILLISECONDS_IN_SECOND).round, 3, f) + emit_n((sec_fraction / MILLISECONDS_IN_SECOND).floor, 3, f) when 'l'; emit_a((hour % 12).nonzero? || 12, 2, f) when 'M', 'OM'; emit_n(min, 2, f) when 'm', 'Om'; emit_n(mon, 2, f) when 'N' - emit_n((sec_fraction / NANOSECONDS_IN_SECOND).round, 9, f) + emit_n((sec_fraction / NANOSECONDS_IN_SECOND).floor, 9, f) when 'n'; "\n" when 'P'; emit_ad(strftime('%p').downcase, 0, f) when 'p'; emit_au(if hour < 12 then 'AM' else 'PM' end, 0, f) |