Skip to content

Instantly share code, notes, and snippets.

@leejarvis

leejarvis/a.rb Secret

Created July 29, 2015 13:10
Show Gist options
  • Save leejarvis/88f9c43d6ea9c1fda4e3 to your computer and use it in GitHub Desktop.
Save leejarvis/88f9c43d6ea9c1fda4e3 to your computer and use it in GitHub Desktop.
@date_gt = get_date
def get_date
if params[:date_gt].present?
DateTime.strptime(params[:date_gt], '%m/%d/%Y')
else
6.months.ago.to_date
end
end
@date_gt = 6.months.ago.to_date
if params[:date_gt].present?
@date_gt = DateTime.strptime(params[:date_gt], '%m/%d/%Y')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment