summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-04 05:02:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-04 05:02:54 +0000
commit7292b0748af8267179e0c0f0c43be7fb38650931 (patch)
tree216c7925659c61c144e34b58832760ced094f2f3
parent04e7dfb1a53748edc5b340534d198610129f7054 (diff)
* lib/date/format.rb (__strptime, strftime): allow multi-line patterns
in Date#strftime the same as Time#strftime accepts. fixed: [ruby-core:08466] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/date/format.rb4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c9513d662..e292a69e24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Aug 4 14:02:14 2006 <nobu@ruby-lang.org>
+
+ * lib/date/format.rb (__strptime, strftime): allow multi-line patterns
+ in Date#strftime the same as Time#strftime accepts.
+ fixed: [ruby-core:08466]
+
Fri Aug 4 13:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* pack.c (pack_pack): check argument overrun for 'P'. based on a
diff --git a/lib/date/format.rb b/lib/date/format.rb
index babcffbfc5..52eecaf2a2 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -51,7 +51,7 @@ class Date
}
def self.__strptime(str, fmt, elem)
- fmt.scan(/%[EO]?.|./o) do |c|
+ fmt.scan(/%[EO]?.|./mo) do |c|
cc = c.sub(/\A%[EO]?(.)\Z/o, '%\\1')
case cc
when /\A\s/o
@@ -490,7 +490,7 @@ class Date
def strftime(fmt='%F')
o = ''
- fmt.scan(/%[EO]?.|./o) do |c|
+ fmt.scan(/%[EO]?.|./mo) do |c|
cc = c.sub(/^%[EO]?(.)$/o, '%\\1')
case cc
when '%A'; o << DAYNAMES[wday]