Skip to content

Instantly share code, notes, and snippets.

@kraft001
Created January 12, 2012 06:14
Show Gist options
  • Save kraft001/1599050 to your computer and use it in GitHub Desktop.
Save kraft001/1599050 to your computer and use it in GitHub Desktop.
Parse date hash to the Date object
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