mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/date.rb (Date#>>): fixed. [ruby-core:28011]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
652484598d
commit
5d8f695032
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Mar 22 19:31:06 2010 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* lib/date.rb (Date#>>): fixed. [ruby-core:28011]
|
||||
|
||||
Mon Mar 22 18:01:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (RMDIRS): use rmdir -p if possible.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# date.rb - date and time library
|
||||
#
|
||||
# Author: Tadayoshi Funaba 1998-2009
|
||||
# Author: Tadayoshi Funaba 1998-2010
|
||||
#
|
||||
# Documentation: William Webber <william@williamwebber.com>
|
||||
#
|
||||
|
@ -1416,7 +1416,10 @@ class Date
|
|||
y, m = (year * 12 + (mon - 1) + n).divmod(12)
|
||||
m, = (m + 1) .divmod(1)
|
||||
d = mday
|
||||
d -= 1 until jd2 = _valid_civil?(y, m, d, @sg)
|
||||
until jd2 = _valid_civil?(y, m, d, @sg)
|
||||
d -= 1
|
||||
raise ArgumentError, 'invalid date' unless d > 0
|
||||
end
|
||||
self + (jd2 - jd)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue