Merge branch 'master' of github.com:johnbintz/formtastic-separate_html5_date_and_time

This commit is contained in:
John Bintz 2013-01-25 08:43:20 -05:00
commit 4cd16eeb34
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,15 @@ class SeparateDateAndTimePickerInput < Formtastic::Inputs::DatetimePickerInput
value_parts.last value_parts.last
end end
def value
return options[:input_html][:value] if options[:input_html] && options[:input_html].key?(:value)
val = object.send(method)
return val.strftime('%Y-%m-%d %H:%M') if val.kind_of?(DateTime)
super
end
def value_parts def value_parts
@value_parts ||= (value || '').split(' ') @value_parts ||= (value || '').split(' ')
end end