diff options
| author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-20 00:56:08 +0000 |
|---|---|---|
| committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-20 00:56:08 +0000 |
| commit | f8f9b939fc921fc8eaded262ad4cbe49fb90d96a (patch) | |
| tree | a8ceb224eac27c30f12d0915c822daaaef34a944 /lib/date.rb | |
| parent | e4c12c560e503f334abd661fc14290fc851ac6e3 (diff) | |
| download | ruby-f8f9b939fc921fc8eaded262ad4cbe49fb90d96a.tar.gz ruby-f8f9b939fc921fc8eaded262ad4cbe49fb90d96a.tar.xz ruby-f8f9b939fc921fc8eaded262ad4cbe49fb90d96a.zip | |
synchronized with date2 3.6.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date.rb')
| -rw-r--r-- | lib/date.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/date.rb b/lib/date.rb index 0747da129..fabdc5bdc 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 |
