private Method

InstanceTag.default_time_from_options(default)

There's no documentation for this item.

Source Code

# File action_view/helpers/date_helper.rb, line 654
def default_time_from_options(default)
  case default
    when nil
      Time.now
    when Date, Time
      default
    else
      # Rename :minute and :second to :min and :sec
      default[:min] ||= default[:minute]
      default[:sec] ||= default[:second]

      [:year, :month, :day, :hour, :min, :sec].each do |key|
        default[key] ||= Time.now.send(key)
      end

      Time.mktime(default[:year], default[:month], default[:day],
                  default[:hour], default[:min],   default[:sec])
    end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.