Sha256: fba505ca35011f92d7694205229967754661ef38421d946b36c061e89e2ff61a

Contents?: true

Size: 1.31 KB

Versions: 18

Compression:

Stored size: 1.31 KB

Contents

module Wice
  module Columns #:nodoc:
    class ViewColumnRailsDateHelper < ViewColumn #:nodoc:

      include ActionView::Helpers::DateHelper
      include Wice::Columns::CommonDateDatetimeMixin
      include Wice::Columns::CommonStandardDateDatetimeMixin

      def chunk_names #:nodoc:
        %w(year month day)
      end

      def do_render(params) #:nodoc:
        '<div class="date-filter">' +
          select_date(params[:fr], include_blank: true, prefix: @name1, id: @dom_id) + '<br/>' +
          select_date(params[:to], include_blank: true, prefix: @name2, id: @dom_id2) +
          '</div>'
      end

      # name_and_id_from_options in Rails Date helper does not substitute '.' with '_'
      # like all other simpler form helpers do. Thus, overriding it here.
      def name_and_id_from_options(options, type)  #:nodoc:
        options[:name] = (options[:prefix] || DEFAULT_PREFIX) + (options[:discard_type] ? '' : "[#{type}]")
        options[:id] = options[:name].gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '').gsub(/\./, '_').gsub(/_+/, '_')
      end


      def has_auto_reloading_calendar? #:nodoc:
        false
      end

    end

    class ConditionsGeneratorColumnRailsDateHelper < ConditionsGeneratorColumn  #:nodoc:

      include Wice::Columns::CommonRailsDateDatetimeConditionsGeneratorMixin

    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
wice_grid-7.1.4 lib/wice/columns/column_rails_date_helper.rb
wice_grid-7.1.3 lib/wice/columns/column_rails_date_helper.rb
wice_grid-7.1.2 lib/wice/columns/column_rails_date_helper.rb
wice_grid-7.1.1 lib/wice/columns/column_rails_date_helper.rb
wice_grid-7.1.0 lib/wice/columns/column_rails_date_helper.rb
wice_grid-6.1.3 lib/wice/columns/column_rails_date_helper.rb
wice_grid-6.1.2 lib/wice/columns/column_rails_date_helper.rb
wice_grid-6.1.1 lib/wice/columns/column_rails_date_helper.rb
wice_grid-6.1.0 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-7.0.0 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-6.1.2 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-6.1.1 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-6.1.0 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-5.0.2 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-5.0.1 lib/wice/columns/column_rails_date_helper.rb
pwice_grid-5.0.0 lib/wice/columns/column_rails_date_helper.rb
wice_grid-4.1.0 lib/wice/columns/column_rails_date_helper.rb
wice_grid-3.6.2 lib/wice/columns/column_rails_date_helper.rb