Sha256: e2f75809bb87564615d63e6f12b0a5d4407cb40fefeaa2d5b802af70eb724464

Contents?: true

Size: 896 Bytes

Versions: 5

Compression:

Stored size: 896 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
rails_admin-3.0.0 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.0.0.rc4 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.0.0.rc3 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.0.0.rc2 lib/rails_admin/config/fields/types/date.rb
rails_admin-3.0.0.rc lib/rails_admin/config/fields/types/date.rb