Class: RailsAdmin::Config::Fields::Types::Datetime
- Defined in:
- lib/rails_admin/config/fields/types/datetime.rb
Constant Summary
Constants inherited from Base
Base::NAMED_INSTANCE_VARIABLES
Instance Attribute Summary
Attributes inherited from Base
#abstract_model, #defined, #name, #order, #parent, #properties, #root, #section
Instance Method Summary collapse
- #filter_options ⇒ Object
- #form_value ⇒ Object
- #parse_input(params) ⇒ Object
- #parse_value(value) ⇒ Object
Methods inherited from Base
#association?, #eager_load_values, #editable?, #errors, #form_default_value, #generic_field_help, #generic_help, #initialize, #inverse_of, #method_name, #optional, #optional=, #optional?, #sort_column, #type, #type_css_class, #value, #virtual?
Methods included from Inspectable
Methods included from Groupable
Methods included from Hideable
#hidden?, #hide, included, #show
Methods included from Configurable
#has_option?, #register_deprecated_instance_option, #register_instance_option
Methods included from Proxyable
Constructor Details
This class inherits a constructor from RailsAdmin::Config::Fields::Base
Instance Method Details
#filter_options ⇒ Object
25 26 27 28 29 |
# File 'lib/rails_admin/config/fields/types/datetime.rb', line 25 def super.merge( datetimepicker_options: , ) end |
#form_value ⇒ Object
89 90 91 |
# File 'lib/rails_admin/config/fields/types/datetime.rb', line 89 def form_value value&.in_time_zone&.strftime('%FT%T') || form_default_value end |
#parse_input(params) ⇒ Object
17 18 19 |
# File 'lib/rails_admin/config/fields/types/datetime.rb', line 17 def parse_input(params) params[name] = parse_value(params[name]) if params[name] end |
#parse_value(value) ⇒ Object
13 14 15 |
# File 'lib/rails_admin/config/fields/types/datetime.rb', line 13 def parse_value(value) ::Time.zone.parse(value) end |