select_year

select_year(date, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the five years on each side of the current, which is selected. The five year radius can be changed using the :start_year and :end_year keys in the options. Both ascending and descending year lists are supported by making :start_year less than or greater than :end_year. The date can also be substituted for a year given as a number. Override the field name using th

select_time

select_time(datetime = Time.current, options = {}, html_options = {}) Instance Public methods Returns a set of html select-tags (one for hour and minute). You can set :time_separator key to format the output, and the :include_seconds option to include an input for seconds. If anything is passed in the html_options hash it will be applied to every select tag in the set. my_time = Time.now + 5.days + 7.hours + 3.minutes + 14.seconds # Generates a time select that defaults to the tim

select_second

select_second(datetime, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, 'second' by default. my_time = Time.now + 16.minutes # Generates a select field for seconds that defaults to the seconds for the time in my_time. select_second(my_time) # Gener

select_month

select_month(date, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the months January through December with the current month selected. The month names are presented as keys (what's shown to the user) and the month numbers (1-12) are used as values (what's submitted to the server). It's also possible to use month numbers for the presentation instead of names â set the :use_month_numbers key in options to true for this to happen

select_minute

select_minute(datetime, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, 'minute' by default. my_time = Time.now + 6.hours # Generates a select fi

select_hour

select_hour(datetime, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. The datetime can be either a Time or DateTime object or an integer. Override the field name using the :field_name option, 'hour' by default. my_time = Time.now + 6.hours # Generates a select field for hours that defaults to the hour for the time in my_time. select_hour(my_time) # Generates a select fiel

select_day

select_day(date, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the days 1 through 31 with the current day selected. The date can also be substituted for a day number. If you want to display days with a leading zero set the :use_two_digit_numbers key in options to true. Override the field name using the :field_name option, 'day' by default. my_date = Time.now + 2.days # Generates a select field for days that defaults to the d

select_datetime

select_datetime(datetime = Time.current, options = {}, html_options = {}) Instance Public methods Returns a set of html select-tags (one for year, month, day, hour, minute, and second) pre-selected with the datetime. It's also possible to explicitly set the order of the tags using the :order option with an array of symbols :year, :month and :day in the desired order. If you do not supply a Symbol, it will be appended onto the :order passed in. You can also add :date_separator, :dat

select_date

select_date(date = Date.current, options = {}, html_options = {}) Instance Public methods Returns a set of html select-tags (one for year, month, and day) pre-selected with the date. It's possible to explicitly set the order of the tags using the :order option with an array of symbols :year, :month and :day in the desired order. If the array passed to the :order option does not contain all the three symbols, all tags will be hidden. If anything is passed in the html_options hash it

distance_of_time_in_words_to_now

distance_of_time_in_words_to_now(from_time, include_seconds_or_options = {}) Instance Public methods Alias for: time_ago_in_words