Class: Skyline::Editors::Date

Inherits:
Editor
  • Object
show all
Defined in:
app/helpers/skyline/editors/date.rb

Instance Method Summary collapse

Instance Method Details

#output_without_errorsObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/skyline/editors/date.rb', line 3

def output_without_errors
  value = field.value(record)
  value ||= ::Date.today
  
  year_options = field.year_options || {}
  year_options.merge!({:field_name => "#{field.attribute_name}(1i)", :prefix => input_name(self.attribute_names[0..-2])})
  
  select_day(value, :field_name => "#{field.attribute_name}(3i)", :prefix => input_name(self.attribute_names[0..-2])) + 
  select_month(value, :field_name => "#{field.attribute_name}(2i)", :prefix => input_name(self.attribute_names[0..-2])) + 
  select_year(value, year_options)
end