diff --git a/app/views/alchemy/ingredients/_datetime_editor.html.erb b/app/views/alchemy/ingredients/_datetime_editor.html.erb index 1d4524250b..a318475f04 100644 --- a/app/views/alchemy/ingredients/_datetime_editor.html.erb +++ b/app/views/alchemy/ingredients/_datetime_editor.html.erb @@ -7,7 +7,8 @@ datetime_editor, :value, { name: datetime_editor.form_field_name, id: datetime_editor.form_field_id, - value: datetime_editor.value + value: datetime_editor.value, + type: datetime_editor.settings[:input_type] } ) %> <% end %> diff --git a/spec/dummy/config/alchemy/elements.yml b/spec/dummy/config/alchemy/elements.yml index 2510ae6c20..b211b28a0a 100644 --- a/spec/dummy/config/alchemy/elements.yml +++ b/spec/dummy/config/alchemy/elements.yml @@ -167,6 +167,8 @@ - role: datetime type: Datetime hint: true + settings: + input_type: datetime - role: file type: File hint: true diff --git a/spec/views/alchemy/ingredients/datetime_editor_spec.rb b/spec/views/alchemy/ingredients/datetime_editor_spec.rb index 56bcbea4cc..9280697cf3 100644 --- a/spec/views/alchemy/ingredients/datetime_editor_spec.rb +++ b/spec/views/alchemy/ingredients/datetime_editor_spec.rb @@ -17,6 +17,6 @@ it "renders a datepicker" do render element_editor - expect(rendered).to have_css('input[type="text"][data-datepicker-type="date"].date') + expect(rendered).to have_css('input[type="text"][data-datepicker-type="datetime"].datetime') end end