lib/avo/fields/date_field.rb
module Avo module Fields class DateField < TextField attr_reader :first_day_of_week attr_reader :picker_format attr_reader :disable_mobile attr_reader :format attr_reader :picker_options def initialize(id, **args, &block) super(id, **args, &block) add_string_prop args, :first_day_of_week, 1 add_string_prop args, :picker_format, "Y-m-d" add_string_prop args, :format, "yyyy-LL-dd" add_boolean_prop args, :disable_mobile add_object_prop args, :picker_options end def formatted_value return if value.blank? try_iso8601 end def edit_formatted_value formatted_value end private def try_iso8601 if value.respond_to?(:iso8601) value.iso8601 elsif value.is_a?(String) parsed = DateTime.parse(value.dup) if parsed.present? parsed end else value end end end end end
Source Files
- app/components/avo/actions_component.rb
- app/components/avo/alert_component.rb
- app/components/avo/asset_manager/javascript_component.rb
- app/components/avo/asset_manager/stylesheet_component.rb
- app/components/avo/base_component.rb
- app/components/avo/blank_field_component.rb
- app/components/avo/button_component.rb
- app/components/avo/empty_state_component.rb
- app/components/avo/field_wrapper_component.rb
- app/components/avo/fields/area_field/edit_component.rb
- app/components/avo/fields/area_field/show_component.rb
- app/components/avo/fields/badge_field/index_component.rb
- app/components/avo/fields/badge_field/show_component.rb
- app/components/avo/fields/belongs_to_field/edit_component.rb
- app/components/avo/fields/belongs_to_field/index_component.rb
- app/components/avo/fields/belongs_to_field/show_component.rb
- app/components/avo/fields/boolean_field/edit_component.rb
- app/components/avo/fields/boolean_field/index_component.rb
- app/components/avo/fields/boolean_field/show_component.rb
- app/components/avo/fields/boolean_group_field/edit_component.rb
- app/components/avo/fields/boolean_group_field/index_component.rb
- app/components/avo/fields/boolean_group_field/show_component.rb
- app/components/avo/fields/code_field/edit_component.rb
- app/components/avo/fields/code_field/show_component.rb
- app/components/avo/fields/common/badge_viewer_component.rb
- app/components/avo/fields/common/boolean_check_component.rb
- app/components/avo/fields/common/boolean_group_component.rb
- app/components/avo/fields/common/files/controls_component.rb
- app/components/avo/fields/common/files/list_viewer_component.rb
- app/components/avo/fields/common/files/view_type/grid_component.rb
- app/components/avo/fields/common/files/view_type/list_component.rb
- app/components/avo/fields/common/gravatar_viewer_component.rb
- app/components/avo/fields/common/heading_component.rb
- app/components/avo/fields/common/key_value_component.rb
- app/components/avo/fields/common/progress_bar_component.rb
- app/components/avo/fields/common/status_viewer_component.rb
- app/components/avo/fields/concerns/item_labels.rb
- app/components/avo/fields/country_field/edit_component.rb
- app/components/avo/fields/country_field/index_component.rb
- app/components/avo/fields/country_field/show_component.rb
- app/components/avo/fields/date_field/edit_component.rb
- app/components/avo/fields/date_field/index_component.rb
- app/components/avo/fields/date_field/show_component.rb
- app/components/avo/fields/date_time_field/edit_component.rb
- app/components/avo/fields/date_time_field/index_component.rb
- app/components/avo/fields/date_time_field/show_component.rb
- app/components/avo/fields/edit_component.rb
- app/components/avo/fields/external_image_field/edit_component.rb
- app/components/avo/fields/external_image_field/index_component.rb
- app/components/avo/fields/external_image_field/show_component.rb
- app/components/avo/fields/file_field/edit_component.rb
- app/components/avo/fields/file_field/index_component.rb
- app/components/avo/fields/file_field/show_component.rb
- app/components/avo/fields/files_field/edit_component.rb
- app/components/avo/fields/files_field/index_component.rb
- app/components/avo/fields/files_field/show_component.rb
- app/components/avo/fields/gravatar_field/index_component.rb
- app/components/avo/fields/gravatar_field/show_component.rb
- app/components/avo/fields/has_many_field/show_component.rb
- app/components/avo/fields/has_one_field/index_component.rb
- app/components/avo/fields/has_one_field/show_component.rb
- app/components/avo/fields/heading_field/edit_component.rb
- app/components/avo/fields/heading_field/show_component.rb
- app/components/avo/fields/hidden_field/edit_component.rb
- app/components/avo/fields/id_field/edit_component.rb
- app/components/avo/fields/id_field/index_component.rb
- app/components/avo/fields/id_field/show_component.rb
- app/components/avo/fields/index_component.rb
- app/components/avo/fields/key_value_field/edit_component.rb
- app/components/avo/fields/key_value_field/show_component.rb
- app/components/avo/fields/location_field/edit_component.rb
- app/components/avo/fields/location_field/show_component.rb
- app/components/avo/fields/markdown_field/edit_component.rb
- app/components/avo/fields/markdown_field/show_component.rb
- app/components/avo/fields/number_field/edit_component.rb
- app/components/avo/fields/number_field/index_component.rb
- app/components/avo/fields/number_field/show_component.rb
- app/components/avo/fields/password_field/edit_component.rb
- app/components/avo/fields/preview_field/index_component.rb
- app/components/avo/fields/progress_bar_field/edit_component.rb
- app/components/avo/fields/progress_bar_field/index_component.rb
- app/components/avo/fields/progress_bar_field/show_component.rb
- app/components/avo/fields/select_field/edit_component.rb
- app/components/avo/fields/select_field/index_component.rb
- app/components/avo/fields/select_field/show_component.rb
- app/components/avo/fields/show_component.rb
- app/components/avo/fields/status_field/edit_component.rb
- app/components/avo/fields/status_field/index_component.rb
- app/components/avo/fields/status_field/show_component.rb
- app/components/avo/fields/text_field/edit_component.rb
- app/components/avo/fields/text_field/index_component.rb
- app/components/avo/fields/text_field/show_component.rb
- app/components/avo/fields/textarea_field/edit_component.rb
- app/components/avo/fields/textarea_field/show_component.rb
- app/components/avo/fields/time_field/edit_component.rb
- app/components/avo/fields/time_field/index_component.rb
- app/components/avo/fields/time_field/show_component.rb
- app/components/avo/fields/trix_field/edit_component.rb
- app/components/avo/fields/trix_field/show_component.rb
- app/components/avo/filters_component.rb
- app/components/avo/flash_alerts_component.rb
- app/components/avo/index/field_wrapper_component.rb
- app/components/avo/index/grid_cover_empty_state_component.rb
- app/components/avo/index/grid_item_component.rb
- app/components/avo/index/resource_controls_component.rb
- app/components/avo/index/resource_grid_component.rb
- app/components/avo/index/resource_map_component.rb
- app/components/avo/index/resource_table_component.rb
- app/components/avo/index/table_row_component.rb
- app/components/avo/item_switcher_component.rb
- app/components/avo/loading_component.rb
- app/components/avo/modal_component.rb
- app/components/avo/paginator_component.rb
- app/components/avo/panel_component.rb
- app/components/avo/profile_item_component.rb
- app/components/avo/referrer_params_component.rb
- app/components/avo/resource_component.rb
- app/components/avo/resource_sidebar_component.rb
- app/components/avo/row_component.rb
- app/components/avo/sidebar/base_item_component.rb
- app/components/avo/sidebar/group_component.rb
- app/components/avo/sidebar/heading_component.rb
- app/components/avo/sidebar/link_component.rb
- app/components/avo/sidebar/section_component.rb
- app/components/avo/sidebar_component.rb
- app/components/avo/sidebar_profile_component.rb
- app/components/avo/tab_group_component.rb
- app/components/avo/tab_switcher_component.rb
- app/components/avo/turbo_frame_wrapper_component.rb
- app/components/avo/views/resource_edit_component.rb
- app/components/avo/views/resource_index_component.rb
- app/components/avo/views/resource_show_component.rb
- app/controllers/avo/actions_controller.rb
- app/controllers/avo/application_controller.rb
- app/controllers/avo/associations_controller.rb
- app/controllers/avo/attachments_controller.rb
- app/controllers/avo/base_controller.rb
- app/controllers/avo/debug_controller.rb
- app/controllers/avo/home_controller.rb
- app/controllers/avo/private_controller.rb
- app/controllers/avo/resources_controller.rb
- app/controllers/avo/search_controller.rb
- app/controllers/avo/team_users_controller.rb
- app/controllers/concerns/avo/initializes_avo.rb
- app/helpers/avo/application_helper.rb
- app/helpers/avo/resources_helper.rb
- app/helpers/avo/url_helpers.rb
- lib/avo.rb
- lib/avo/action_model.rb
- lib/avo/asset_manager.rb
- lib/avo/base_action.rb
- lib/avo/base_resource.rb
- lib/avo/base_resource_tool.rb
- lib/avo/concerns/breadcrumbs.rb
- lib/avo/concerns/can_replace_items.rb
- lib/avo/concerns/filters_session_handler.rb
- lib/avo/concerns/has_controls.rb
- lib/avo/concerns/has_description.rb
- lib/avo/concerns/has_item_type.rb
- lib/avo/concerns/has_items.rb
- lib/avo/concerns/has_stimulus_controllers.rb
- lib/avo/concerns/is_resource_item.rb
- lib/avo/concerns/is_visible.rb
- lib/avo/concerns/model_class_constantized.rb
- lib/avo/concerns/visible_in_different_views.rb
- lib/avo/configuration.rb
- lib/avo/configuration/branding.rb
- lib/avo/configuration/resource_configuration.rb
- lib/avo/current.rb
- lib/avo/dsl/field_parser.rb
- lib/avo/dynamic_router.rb
- lib/avo/engine.rb
- lib/avo/error_manager.rb
- lib/avo/execution_context.rb
- lib/avo/fields/area_field.rb
- lib/avo/fields/badge_field.rb
- lib/avo/fields/base_field.rb
- lib/avo/fields/belongs_to_field.rb
- lib/avo/fields/boolean_field.rb
- lib/avo/fields/boolean_group_field.rb
- lib/avo/fields/code_field.rb
- lib/avo/fields/concerns/file_authorization.rb
- lib/avo/fields/concerns/handles_field_args.rb
- lib/avo/fields/concerns/has_default.rb
- lib/avo/fields/concerns/has_field_name.rb
- lib/avo/fields/concerns/has_html_attributes.rb
- lib/avo/fields/concerns/is_disabled.rb
- lib/avo/fields/concerns/is_readonly.rb
- lib/avo/fields/concerns/is_required.rb
- lib/avo/fields/concerns/is_searchable.rb
- lib/avo/fields/concerns/use_resource.rb
- lib/avo/fields/country_field.rb
- lib/avo/fields/date_field.rb
- lib/avo/fields/date_time_field.rb
- lib/avo/fields/external_image_field.rb
- lib/avo/fields/field_extensions/has_include_blank.rb
- lib/avo/fields/field_manager.rb
- lib/avo/fields/file_field.rb
- lib/avo/fields/files_field.rb
- lib/avo/fields/gravatar_field.rb
- lib/avo/fields/has_and_belongs_to_many_field.rb
- lib/avo/fields/has_base_field.rb
- lib/avo/fields/has_many_field.rb
- lib/avo/fields/has_one_field.rb
- lib/avo/fields/heading_field.rb
- lib/avo/fields/hidden_field.rb
- lib/avo/fields/id_field.rb
- lib/avo/fields/key_value_field.rb
- lib/avo/fields/location_field.rb
- lib/avo/fields/markdown_field.rb
- lib/avo/fields/number_field.rb
- lib/avo/fields/password_field.rb
- lib/avo/fields/preview_field.rb
- lib/avo/fields/progress_bar_field.rb
- lib/avo/fields/select_field.rb
- lib/avo/fields/status_field.rb
- lib/avo/fields/text_field.rb
- lib/avo/fields/textarea_field.rb
- lib/avo/fields/time_field.rb
- lib/avo/fields/trix_field.rb
- lib/avo/filters/base_filter.rb
- lib/avo/filters/boolean_filter.rb
- lib/avo/filters/multiple_select_filter.rb
- lib/avo/filters/select_filter.rb
- lib/avo/filters/text_filter.rb
- lib/avo/grid_fields/body_field.rb
- lib/avo/grid_fields/grid_field.rb
- lib/avo/grid_fields/preview_field.rb
- lib/avo/grid_fields/title_field.rb
- lib/avo/html/builder.rb
- lib/avo/item_grapher.rb
- lib/avo/licensing/community_license.rb
- lib/avo/licensing/h_q.rb
- lib/avo/licensing/license.rb
- lib/avo/licensing/license_manager.rb
- lib/avo/licensing/nil_license.rb
- lib/avo/licensing/pro_license.rb
- lib/avo/loaders/actions_loader.rb
- lib/avo/loaders/fields_loader.rb
- lib/avo/loaders/filters_loader.rb
- lib/avo/loaders/loader.rb
- lib/avo/plugin.rb
- lib/avo/plugin_manager.rb
- lib/avo/prefixed_test_helpers.rb
- lib/avo/reloader.rb
- lib/avo/resources/controls/actions_list.rb
- lib/avo/resources/controls/attach_button.rb
- lib/avo/resources/controls/back_button.rb
- lib/avo/resources/controls/base_control.rb
- lib/avo/resources/controls/create_button.rb
- lib/avo/resources/controls/delete_button.rb
- lib/avo/resources/controls/detach_button.rb
- lib/avo/resources/controls/edit_button.rb
- lib/avo/resources/controls/order_controls.rb
- lib/avo/resources/controls/save_button.rb
- lib/avo/resources/controls/show_button.rb
- lib/avo/resources/items/holder.rb
- lib/avo/resources/items/item_group.rb
- lib/avo/resources/items/main_panel.rb
- lib/avo/resources/items/panel.rb
- lib/avo/resources/items/row.rb
- lib/avo/resources/items/sidebar.rb
- lib/avo/resources/items/tab.rb
- lib/avo/resources/items/tab_group.rb
- lib/avo/resources/resource_manager.rb
- lib/avo/services/authorization_service.rb
- lib/avo/services/debug_service.rb
- lib/avo/services/encryption_service.rb
- lib/avo/services/telemetry_service.rb
- lib/avo/services/uri_service.rb
- lib/avo/svg_finder.rb
- lib/avo/test_helpers.rb
- lib/avo/tools/tool_manager.rb
- lib/avo/version.rb
- lib/generators/avo/action_generator.rb
- lib/generators/avo/base_generator.rb
- lib/generators/avo/card_generator.rb
- lib/generators/avo/concerns/parent_controller.rb
- lib/generators/avo/controller_generator.rb
- lib/generators/avo/dashboard_generator.rb
- lib/generators/avo/eject_generator.rb
- lib/generators/avo/field_generator.rb
- lib/generators/avo/filter_generator.rb
- lib/generators/avo/install_generator.rb
- lib/generators/avo/js/install_generator.rb
- lib/generators/avo/locales_generator.rb
- lib/generators/avo/named_base_generator.rb
- lib/generators/avo/resource_generator.rb
- lib/generators/avo/resource_tool_generator.rb
- lib/generators/avo/scope_generator.rb
- lib/generators/avo/tailwindcss/install_generator.rb
- lib/generators/avo/tool_generator.rb
- lib/generators/avo/version_generator.rb
- lib/generators/model_generator.rb
- lib/generators/rails/avo_resource_generator.rb