diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-20 09:36:02 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-20 09:36:02 -0800 |
commit | 6bb4ad3868b0605ec43dbab5a489563c5909e828 (patch) | |
tree | cefd88f552b38076a9fb3080fc54b206bcb5cb06 /actionpack/lib/action_view/helpers/date_helper.rb | |
parent | 7ab47751068c6480e7e44fc9265a7e690dd4af3b (diff) | |
parent | 92088131ac15734f2227e9d85ea751e3f89b0116 (diff) | |
download | rails-6bb4ad3868b0605ec43dbab5a489563c5909e828.tar.gz rails-6bb4ad3868b0605ec43dbab5a489563c5909e828.tar.bz2 rails-6bb4ad3868b0605ec43dbab5a489563c5909e828.zip |
Merge pull request #4033 from nashby/date-helper-field-error-proc
add failing tests for issue #3487
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/date_helper.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index dd2b59cb0a..2806348337 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -422,7 +422,7 @@ module ActionView end # Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. - # The <tt>datetime</tt> can be either a +Time+ or +DateTime+ object or an integer. + # The <tt>datetime</tt> can be either a +Time+ or +DateTime+ object or an integer. # Override the field name using the <tt>:field_name</tt> option, 'second' by default. # # ==== Examples @@ -448,7 +448,7 @@ module ActionView # Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected. # Also can return a select tag with options by <tt>minute_step</tt> from 0 through 59 with the 00 minute - # selected. The <tt>datetime</tt> can be either a +Time+ or +DateTime+ object or an integer. + # selected. The <tt>datetime</tt> can be either a +Time+ or +DateTime+ object or an integer. # Override the field name using the <tt>:field_name</tt> option, 'minute' by default. # # ==== Examples @@ -473,7 +473,7 @@ module ActionView end # Returns a select tag with options for each of the hours 0 through 23 with the current hour selected. - # The <tt>datetime</tt> can be either a +Time+ or +DateTime+ object or an integer. + # The <tt>datetime</tt> can be either a +Time+ or +DateTime+ object or an integer. # Override the field name using the <tt>:field_name</tt> option, 'hour' by default. # # ==== Examples @@ -868,7 +868,7 @@ module ActionView tag_options = { :value => value } tag_options[:selected] = "selected" if selected == i text = options[:use_two_digit_numbers] ? sprintf("%02d", i) : value - text = options[:ampm] ? AMPM_TRANSLATION[i] : text + text = options[:ampm] ? AMPM_TRANSLATION[i] : text select_options << content_tag(:option, text, tag_options) end (select_options.join("\n") + "\n").html_safe @@ -974,7 +974,7 @@ module ActionView end end - class InstanceTag #:nodoc: + module DateHelperInstanceTag def to_date_select_tag(options = {}, html_options = {}) datetime_selector(options, html_options).select_date.html_safe end @@ -1030,6 +1030,10 @@ module ActionView end end + class InstanceTag #:nodoc: + include DateHelperInstanceTag + end + class FormBuilder def date_select(method, options = {}, html_options = {}) @template.date_select(@object_name, method, objectify_options(options), html_options) |