Issue #12196 has been updated by jeremyevans0 (Jeremy Evans).


I don't think this is a bug in the code, but I do think we should improve the documentation for valid_date.  I've added a pull request to do so: https://github.com/ruby/date/pull/7.

----------------------------------------
Bug #12196: lib: Date.valid_date? returns incorrect response for negative day
https://bugs.ruby-lang.org/issues/12196#change-78899

* Author: ddoherty03 (Daniel Doherty)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.2.2
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
~~~
require 'date'
puts RUBY_VERSION
if Date.valid_date?(2016, 2, -1)
  puts "Valid"
else
  puts "Invalid"
end
~~~

This reports 'Valid' for a negative day number.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>