Actions
Bug #12196
closedlib: Date.valid_date? returns incorrect response for negative day
Bug #12196:
lib: Date.valid_date? returns incorrect response for negative day
Updated by zverok (Victor Shepelev) over 10 years ago
From Date::new docs:
The month and the day of month should be a negative or a positive number (as a relative month/day from the end of year/month when negative). They should not be zero.
From Date.valid_date? docs:
Returns true if the given calendar date is valid, and false if not.
The latter is pretty brief, yet I assume it means rather "valid params for Date.new" than anything else.
Updated by jeremyevans0 (Jeremy Evans) about 7 years ago
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.
Updated by jeremyevans0 (Jeremy Evans) about 7 years ago
- Status changed from Open to Closed
The pull request was merged.
Actions