mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
rss.rb: fix usec width
* lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction digits. [ruby-core:70667] [Bug #11509] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
32c4fd7aa3
commit
88083fa47e
3 changed files with 12 additions and 1 deletions
|
@ -53,7 +53,7 @@ class Time
|
|||
if usec.zero?
|
||||
fraction_digits = 0
|
||||
else
|
||||
fraction_digits = Math.log10(usec.to_s.sub(/0*$/, '').to_i).floor + 1
|
||||
fraction_digits = strftime('%6N').sub!(/0*\z/, '').size
|
||||
end
|
||||
xmlschema(fraction_digits)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue