Last active
April 3, 2018 09:47
-
-
Save maecha/82e6c85f26e31e65f70268d2aca20f39 to your computer and use it in GitHub Desktop.
Creating text-date, Convert Time Class to String Class
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
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