Created
January 12, 2012 06:14
-
-
Save kraft001/1599050 to your computer and use it in GitHub Desktop.
Parse date hash to the Date object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date.civil( | |
*params[:date]. | |
values_at(*%w(year month day)). | |
map(&:to_i) | |
) rescue Time.now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment