aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/date/format.rb2
-rw-r--r--lib/time.rb4
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb
index 7aa4747ecf..f00f60ab47 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -356,7 +356,7 @@ class Date
end
end
- if $1.size > 2
+ if $3 && $1.size > 2
comp = false
year, mon, mday = mon, mday, year
end
diff --git a/lib/time.rb b/lib/time.rb
index 043257a4d1..115e7e9633 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -99,7 +99,7 @@ class Time
# # your timezone is GMT:
# Time.parse("16:30") #=> Thu Nov 29 16:30:00 GMT 2001
# Time.parse("7/23") #=> Mon Jul 23 00:00:00 GMT 2001
- # Time.parse("2002/1") #=> Tue Jan 01 00:00:00 GMT 2002
+ # Time.parse("Aug 31") #=> Fri Aug 31 00:00:00 GMT 2001
#
# Since there are numerous conflicts among locally defined timezone
# abbreviations all over the world, this method is not made to
@@ -525,8 +525,6 @@ if __FILE__ == $0
Time.parse("2001/11/29 21:12", now))
assert_equal(Time.local( 2001,11,29),
Time.parse("2001/11/29", now))
- assert_equal(Time.local( 2001,11),
- Time.parse("2001/11", now))
assert_equal(Time.local( 2001,11,29),
Time.parse( "11/29", now))
#assert_equal(Time.local(2001,11,1), Time.parse("Nov", now))