Flowdock
valid_civil?(y, m, d, sg=ITALY) public

Do year y, month m, and day-of-month d make a valid Civil <a href="/ruby/Date">Date?</a> Returns the corresponding Julian Day Number if they do, nil if they don’t.

m and d can be negative, in which case they count backwards from the end of the year and the end of the month respectively. No wraparound is performed, however, and invalid values cause an ArgumentError to be raised. A date falling in the period skipped in the Day of Calendar Reform adjustment is not valid.

sg specifies the Day of Calendar Reform.

Show source
Register or log in to add new notes.