Skip to content

Instantly share code, notes, and snippets.

@sunchess
Created December 17, 2012 15:49
Show Gist options
  • Save sunchess/4319316 to your computer and use it in GitHub Desktop.
Save sunchess/4319316 to your computer and use it in GitHub Desktop.
filters[:departure_date].each do |str_date|
if str_date.size == 8
updated_date_filters << Date.strptime(str_date, '%d.%m.%y')
else
updated_date_filters << str_date
end
end
#short variant
filters[:departure_date].map!(|d| d.size == 8 ? Date.strptime(d, '%d.%m.%y') : d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment