diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-22 10:55:48 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-22 10:55:48 +0000 |
commit | c45f4fb879cdb78fe4de62471a717414c1c85626 (patch) | |
tree | 6d81ce96def779ba5a79c6eb11d62860750014da /lib/date/format.rb | |
parent | bdd8290d7de047cbfc8bb7c1583a1a8a602c53a3 (diff) | |
download | ruby-c45f4fb879cdb78fe4de62471a717414c1c85626.tar.gz ruby-c45f4fb879cdb78fe4de62471a717414c1c85626.tar.xz ruby-c45f4fb879cdb78fe4de62471a717414c1c85626.zip |
revert
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date/format.rb')
-rw-r--r-- | lib/date/format.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb index 7c500a52d..46d2147b8 100644 --- a/lib/date/format.rb +++ b/lib/date/format.rb @@ -153,8 +153,8 @@ class Date s[0,0] = sign end - if f[:w] - s = f[:n] ? s.ljust(f[:w], f[:p]) : s.rjust(f[:w], f[:p]) + if f[:p] != '-' + s = s.rjust(f[:w], f[:p]) end if f[:s] && f[:p] != "\s" @@ -257,18 +257,12 @@ class Date when 'j'; emit_n(yday, 3, f) when 'k'; emit_a(hour, 2, f) when 'L' - f[:n] = true - w = f[:w] - s = emit_n((sec_fraction / MILLISECONDS_IN_SECOND).floor, 3, f) - w ? s[0, w] : s + 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' - f[:n] = true - w = f[:w] - s = emit_n((sec_fraction / NANOSECONDS_IN_SECOND).floor, 9, f) - w ? s[0, w] : s + 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) |