mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
* ext/date/lib/date/format.rb (_iso8601): added a pattern.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3551c0476
commit
9f103e659e
2 changed files with 20 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Apr 25 03:04:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
|
* ext/date/lib/date/format.rb (_iso8601): added a pattern.
|
||||||
|
|
||||||
Mon Apr 25 02:51:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
Mon Apr 25 02:51:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/date/lib/date/format.rb: require 'date_core.so'.
|
* ext/date/lib/date/format.rb: require 'date_core.so'.
|
||||||
|
@ -6,7 +10,7 @@ Mon Apr 25 02:51:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
Mon Apr 25 02:47:46 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
Mon Apr 25 02:47:46 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* ext/date/lib/date/format.rb: fixed a bug of regex.
|
* ext/date/lib/date/format.rb (_iso8601): fixed a bug of regex.
|
||||||
|
|
||||||
Mon Apr 25 02:12:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
Mon Apr 25 02:12:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,8 @@ class Date
|
||||||
elsif /\A\s*(?:([-+]?(?:\d{4}|\d{2})|--)(\d{2})(\d{2})|
|
elsif /\A\s*(?:([-+]?(?:\d{4}|\d{2})|--)(\d{2})(\d{2})|
|
||||||
([-+]?(?:\d{4}|\d{2}))?(\d{3})|
|
([-+]?(?:\d{4}|\d{2}))?(\d{3})|
|
||||||
-(\d{3})|
|
-(\d{3})|
|
||||||
(\d{4}|\d{2})?w(\d{2})(\d))
|
(\d{4}|\d{2})?w(\d{2})(\d)|
|
||||||
|
-w-(\d))
|
||||||
(?:t?
|
(?:t?
|
||||||
(\d{2})(\d{2})(?:(\d{2})(?:[,.](\d+))?)?
|
(\d{2})(\d{2})(?:(\d{2})(?:[,.](\d+))?)?
|
||||||
(z|[-+]\d{2}(?:\d{2})?)?)?\s*\z/ix =~ str
|
(z|[-+]\d{2}(?:\d{2})?)?)?\s*\z/ix =~ str
|
||||||
|
@ -252,18 +253,22 @@ class Date
|
||||||
end
|
end
|
||||||
e[:cwyear] = y
|
e[:cwyear] = y
|
||||||
end
|
end
|
||||||
|
elsif $10
|
||||||
|
e = {
|
||||||
|
:cwday => $10.to_i
|
||||||
|
}
|
||||||
end
|
end
|
||||||
if $10
|
if $11
|
||||||
e[:hour] = $10.to_i
|
e[:hour] = $11.to_i
|
||||||
e[:min] = $11.to_i
|
e[:min] = $12.to_i
|
||||||
e[:sec] = $12.to_i if $12
|
e[:sec] = $13.to_i if $13
|
||||||
end
|
|
||||||
if $13
|
|
||||||
e[:sec_fraction] = Rational($13.to_i, 10**$13.size)
|
|
||||||
end
|
end
|
||||||
if $14
|
if $14
|
||||||
e[:zone] = $14
|
e[:sec_fraction] = Rational($14.to_i, 10**$14.size)
|
||||||
e[:offset] = zone_to_diff($14)
|
end
|
||||||
|
if $15
|
||||||
|
e[:zone] = $15
|
||||||
|
e[:offset] = zone_to_diff($15)
|
||||||
end
|
end
|
||||||
e
|
e
|
||||||
elsif /\A\s*(?:(\d{2}):(\d{2})(?::(\d{2})(?:[,.](\d+))?)?
|
elsif /\A\s*(?:(\d{2}):(\d{2})(?::(\d{2})(?:[,.](\d+))?)?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue