summaryrefslogtreecommitdiff
path: root/lib/date.rb
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-20 00:48:19 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-20 00:48:19 +0000
commitf2d983cb8dad16cfaa74b71b3efb4eb846858e96 (patch)
tree7627aa53a5ed1ba6574a616c22a1eab1798796cd /lib/date.rb
parent610b5d79759706fb2688b652da1c21006f9d4af2 (diff)
synchronized with date2 3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date.rb')
-rw-r--r--lib/date.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 0747da1295..fabdc5bdc7 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -6,7 +6,7 @@
# Documentation: William Webber <william@williamwebber.com>
#
#--
-# $Id: date.rb,v 2.11 2004-01-19 04:56:12+09 tadf Exp $
+# $Id: date.rb,v 2.12 2004-03-20 08:05:13+09 tadf Exp $
#++
#
# == Overview
@@ -1196,16 +1196,18 @@ class DateTime < Date
def self.new_with_hash(elem, sg)
elem ||= {}
- y, m, d, h, min, s, of =
- elem.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)
+ y, m, d, h, min, s, fr, of =
+ elem.values_at(:year, :mon, :mday,
+ :hour, :min, :sec, :sec_fraction, :offset)
h ||= 0
min ||= 0
s ||= 0
+ fr ||= 0
of ||= 0
if [y, m, d].include? nil
raise ArgumentError, 'invalid date'
else
- civil(y, m, d, h, min, s, of.to_r/86400, sg)
+ civil(y, m, d, h, min, s, of.to_r/86400, sg) + (fr/86400)
end
end