diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/date.rb | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Sun Sep 12 21:21:50 2010 Tadayoshi Funaba <[email protected]> + + * lib/date.rb: [ruby-core:32096] Thanks Colin Bartlett. + Sun Sep 12 19:30:27 2010 Tanaka Akira <[email protected]> * ext/pathname/pathname.c (path_world_writable_p): diff --git a/lib/date.rb b/lib/date.rb index 8b1796201c..37c4b92d48 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -589,7 +589,7 @@ class Date # +sg+ specifies the Day of Calendar Reform. def _valid_ordinal? (y, d, sg=GREGORIAN) # :nodoc: if d < 0 - j = find_ldoy(y, sg) + return unless j = find_ldoy(y, sg) ny, nd = jd_to_ordinal(j + d + 1, sg) return unless ny == y d = nd @@ -616,7 +616,7 @@ class Date m += 13 end if d < 0 - j = find_ldom(y, m, sg) + return unless j = find_ldom(y, m, sg) ny, nm, nd = jd_to_civil(j + d + 1, sg) return unless [ny, nm] == [y, m] d = nd |