1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/date.rb (complete_frags): Monday must be suitable for %W's

default day.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2009-08-11 14:14:41 +00:00
parent 3aabcaa3da
commit 8e6a754b5d
3 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Tue Aug 11 23:12:31 2009 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (complete_frags): Monday must be suitable for %W's
default day.
Tue Aug 11 21:42:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Aug 11 21:42:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (num_divmod): fixed rdoc. [ruby-core:24862] * numeric.c (num_divmod): fixed rdoc. [ruby-core:24862]

View file

@ -1,7 +1,7 @@
# #
# date.rb - date and time library # date.rb - date and time library
# #
# Author: Tadayoshi Funaba 1998-2008 # Author: Tadayoshi Funaba 1998-2009
# #
# Documentation: William Webber <william@williamwebber.com> # Documentation: William Webber <william@williamwebber.com>
# #
@ -927,7 +927,7 @@ class Date
elem[e] = d.__send__(e) elem[e] = d.__send__(e)
end end
elem[:wnum1] ||= 0 elem[:wnum1] ||= 0
elem[:wday] ||= 0 elem[:wday] ||= 1
end end
end end

View file

@ -442,7 +442,7 @@ class TestDateStrptime < Test::Unit::TestCase
assert_equal([n.year, 11, 6, 0, 0, 0], assert_equal([n.year, 11, 6, 0, 0, 0],
[d.year, d.strftime('%W').to_i, d.wday, d.hour, d.min, d.sec]) [d.year, d.strftime('%W').to_i, d.wday, d.hour, d.min, d.sec])
d = DateTime.strptime('2004-11', '%Y-%W') d = DateTime.strptime('2004-11', '%Y-%W')
assert_equal([2004, 11, 0, 0, 0, 0], assert_equal([2004, 11, 1, 0, 0, 0],
[d.year, d.strftime('%W').to_i, d.wday, d.hour, d.min, d.sec]) [d.year, d.strftime('%W').to_i, d.wday, d.hour, d.min, d.sec])
end end