# File lib/action_view/helpers/date_helper.rb, line 981 981: def to_date_select_tag(options = {}, html_options = {}) 982: datetime_selector(options, html_options).select_date.html_safe 983: end
# File lib/action_view/helpers/date_helper.rb, line 994 994: def datetime_selector(options, html_options) 995: datetime = value(object) || default_datetime(options) 996: @auto_index ||= nil 997: 998: options = options.dup 999: options[:field_name] = @method_name 1000: options[:include_position] = true 1001: options[:prefix] ||= @object_name 1002: options[:index] = @auto_index if @auto_index && !options.has_key?(:index) 1003: 1004: DateTimeSelector.new(datetime, options, html_options) 1005: end
# File lib/action_view/helpers/date_helper.rb, line 1007 1007: def default_datetime(options) 1008: return if options[:include_blank] || options[:prompt] 1009: 1010: case options[:default] 1011: when nil 1012: Time.current 1013: when Date, Time 1014: options[:default] 1015: else 1016: default = options[:default].dup 1017: 1018: # Rename :minute and :second to :min and :sec 1019: default[:min] ||= default[:minute] 1020: default[:sec] ||= default[:second] 1021: 1022: time = Time.current 1023: 1024: [:year, :month, :day, :hour, :min, :sec].each do |key| 1025: default[key] ||= time.send(key) 1026: end 1027: 1028: Time.utc_time( 1029: default[:year], default[:month], default[:day], 1030: default[:hour], default[:min], default[:sec] 1031: ) 1032: end 1033: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.