Flowdock
method

select_year

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActionView::Helpers::DateTimeSelector

Method not available on this version

This method is only available on newer versions. The first available version of the method is shown here.

select_year() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_view/helpers/date_helper.rb, line 645
      def select_year
        if !@datetime || @datetime == 0
          val = ''
          middle_year = Date.today.year
        else
          val = middle_year = year
        end

        if @options[:use_hidden] || @options[:discard_year]
          build_hidden(:year, val)
        else
          options                 = {}
          options[:start]         = @options[:start_year] || middle_year - 5
          options[:end]           = @options[:end_year] || middle_year + 5
          options[:step]          = options[:start] < options[:end] ? 1 : -1
          options[:leading_zeros] = false

          build_options_and_select(:year, val, options)
        end
      end
Register or log in to add new notes.