mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/trunk@10662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9b4a611547
commit
d040c69a58
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue