diff options
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rwxr-xr-x | actionpack/lib/action_view/helpers/date_helper.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 0040095669..4920763b50 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -258,6 +258,7 @@ module ActionView defaults = { :discard_type => true } options = defaults.merge(options) options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } + value = value(object) date = options[:include_blank] ? (value || 0) : (value || Date.today) date_select = '' @@ -282,6 +283,7 @@ module ActionView defaults = { :discard_type => true } options = defaults.merge(options) options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } + value = value(object) datetime = options[:include_blank] ? (value || nil) : (value || Time.now) datetime_select = select_year(datetime, options_with_prefix.call(1)) |