[前][次][番号順一覧][スレッド一覧]

ruby-changes:12775

From: tadf <ko1@a...>
Date: Tue, 11 Aug 2009 23:15:03 +0900 (JST)
Subject: [ruby-changes:12775] Ruby:r24500 (trunk): * lib/date.rb (complete_frags): Monday must be suitable for %W's

tadf	2009-08-11 23:14:41 +0900 (Tue, 11 Aug 2009)

  New Revision: 24500

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24500

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

  Modified files:
    trunk/ChangeLog
    trunk/lib/date.rb
    trunk/test/date/test_date_strptime.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24499)
+++ ChangeLog	(revision 24500)
@@ -1,3 +1,8 @@
+Tue Aug 11 23:12:31 2009  Tadayoshi Funaba  <tadf@d...>
+
+	* lib/date.rb (complete_frags): Monday must be suitable for %W's
+	  default day.
+
 Tue Aug 11 21:42:46 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* numeric.c (num_divmod): fixed rdoc.  [ruby-core:24862]
Index: lib/date.rb
===================================================================
--- lib/date.rb	(revision 24499)
+++ lib/date.rb	(revision 24500)
@@ -1,7 +1,7 @@
 #
 # date.rb - date and time library
 #
-# Author: Tadayoshi Funaba 1998-2008
+# Author: Tadayoshi Funaba 1998-2009
 #
 # Documentation: William Webber <william@w...>
 #
@@ -927,7 +927,7 @@
 	  elem[e] = d.__send__(e)
 	end
 	elem[:wnum1] ||= 0
-	elem[:wday]  ||= 0
+	elem[:wday]  ||= 1
       end
     end
 
Index: test/date/test_date_strptime.rb
===================================================================
--- test/date/test_date_strptime.rb	(revision 24499)
+++ test/date/test_date_strptime.rb	(revision 24500)
@@ -442,7 +442,7 @@
     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 = 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])
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]