Sha256: 8f840430e9fb2fe56aba03c26e3418fe3a976cdc2d5dbfb849928cd0d69690ac

Contents?: true

Size: 927 Bytes

Versions: 12

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true

require 'rails_admin/config/fields/types/datetime'

module RailsAdmin
  module Config
    module Fields
      module Types
        class Date < RailsAdmin::Config::Fields::Types::Datetime
          RailsAdmin::Config::Fields::Types.register(self)

          def parse_value(value)
            ::Date.parse(value) if value.present?
          end

          register_instance_option :date_format do
            :long
          end

          register_instance_option :datepicker_options do
            {
              allowInput: true,
              altFormat: flatpickr_format,
            }
          end

          register_instance_option :i18n_scope do
            %i[date formats]
          end

          register_instance_option :html_attributes do
            {
              required: required?,
              size: 18,
            }
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_admin-3.2.1 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.2.0 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.2.0.rc lib/rails_admin/config/fields/types/date.rb
rails_admin-3.2.0.beta lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.4 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.3 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.2 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.1 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.0 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.0.rc2 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.0.rc lib/rails_admin/config/fields/types/date.rb
rails_admin-3.1.0.beta lib/rails_admin/config/fields/types/date.rb