Project

General

Profile

Actions

Bug #12196

closed

lib: Date.valid_date? returns incorrect response for negative day

Added by ddoherty03 (Daniel Doherty) about 8 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:74454]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0