3
4
5
6
7
8
9
10
11
12
|
# File 'lib/incomplete_date/form_builder.rb', line 3
def incomplete_date_select(method, options = {}, html_options = {})
date = @object.send(method) || (Date.today - 50.years)
date = date.to_incomplete_date
options.merge!(:prefix => @object_name, :include_blank => true)
@template.text_field_tag("#{@object_name}[#{method}][year]", date.year, :size => 5, :maxlength => 4) + ' ' +
@template.select_month(date, options.merge(:field_name => "#{method}][month")) + ' ' +
@template.select_day(date, options.merge(:field_name => "#{method}][day")) + ' ' +
@template.check_box_tag("#{@object_name}[#{method}][circa]", '1', date.circa) + ' circa'
end
|