Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Creating text-date, Convert Time Class to String Class
class HogesController < ApplicationController
private
def get_date_text
from = params[:from]
to = params[:to]
wave_dash_text = ' ~ '
get_converted_string_date(from) + wave_dash_text + get_converted_string_date(to)
end
def get_converted_string_date(date)
date.strftime('%Y/%m/%d')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment