summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-28 11:28:23 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-28 11:28:23 +0000
commit3486a98a71d3d2d09258cbd0ab13dc715f750f25 (patch)
tree54f92733067e848ab7ab7412a5361dc793675246
parent97d6e56b0e68d5361809c4571fd1003ee41bffb0 (diff)
* ext/date/date_core.c: [ruby-core:42998]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/date/date_core.c3
-rw-r--r--test/date/test_date_strftime.rb6
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ba736b44a5..d61e92ce8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Feb 28 20:27:25 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:42998]
+
Tue Feb 28 18:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (io_binwrite, rb_io_syswrite): use shared frozen source
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index f9b08cb622..53539b49f1 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -1,5 +1,5 @@
/*
- date_core.c: Coded by Tadayoshi Funaba 2010, 2011
+ date_core.c: Coded by Tadayoshi Funaba 2010-2012
*/
#include "ruby.h"
@@ -8487,6 +8487,7 @@ iso8601_timediv(VALUE self, VALUE n)
{
VALUE fmt;
+ n = to_integer(n);
fmt = rb_usascii_str_new2("T%H:%M:%S");
if (f_gt_p(n, INT2FIX(0))) {
VALUE argv[3];
diff --git a/test/date/test_date_strftime.rb b/test/date/test_date_strftime.rb
index 8b96f16049..76dbed2fc2 100644
--- a/test/date/test_date_strftime.rb
+++ b/test/date/test_date_strftime.rb
@@ -367,9 +367,15 @@ class TestDateStrftime < Test::Unit::TestCase
assert_equal('2001-02-03T04:05:06.123+00:00', d2.iso8601(3))
assert_equal('2001-02-03T04:05:06.123+00:00', d2.rfc3339(3))
assert_equal('H13.02.03T04:05:06.123+00:00', d2.jisx0301(3))
+ assert_equal('2001-02-03T04:05:06.123+00:00', d2.iso8601(3.5))
+ assert_equal('2001-02-03T04:05:06.123+00:00', d2.rfc3339(3.5))
+ assert_equal('H13.02.03T04:05:06.123+00:00', d2.jisx0301(3.5))
assert_equal('2001-02-03T04:05:06.123456000+00:00', d2.iso8601(9))
assert_equal('2001-02-03T04:05:06.123456000+00:00', d2.rfc3339(9))
assert_equal('H13.02.03T04:05:06.123456000+00:00', d2.jisx0301(9))
+ assert_equal('2001-02-03T04:05:06.123456000+00:00', d2.iso8601(9.9))
+ assert_equal('2001-02-03T04:05:06.123456000+00:00', d2.rfc3339(9.9))
+ assert_equal('H13.02.03T04:05:06.123456000+00:00', d2.jisx0301(9.9))
assert_equal('1800-01-01T00:00:00+00:00', DateTime.new(1800).jisx0301)