Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created April 26, 2010 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igaiga/378913 to your computer and use it in GitHub Desktop.
Save igaiga/378913 to your computer and use it in GitHub Desktop.
require 'Date'
def validate_date(year, month, day)
return false if month <= 0 || day <= 0
return false if Date.valid_civil?(year, month, day).nil?
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment