Swap harvest to html5 date field (#3894)

* Update gardens to have a non 0 area

* Spec no longer possible through frontend

* Fix spec

* Swap harvest to html5 date field

* Fix spec
This commit is contained in:
Daniel O'Connor
2024-10-14 00:09:30 +10:30
committed by GitHub
parent 196ca1ba49
commit 58780ec199
2 changed files with 2 additions and 3 deletions

View File

@@ -30,8 +30,7 @@
= link_to "Request new crops.", new_crop_path
.col-md-4
= f.text_field :harvested_at, value: @harvest.harvested_at ? @harvest.harvested_at.to_fs(:ymd) : '',
class: 'add-datepicker', label: 'When?'
= f.date_field :harvested_at, value: @harvest.harvested_at ? @harvest.harvested_at.to_fs(:ymd) : '', label: 'When?'
.col-12
= f.form_group :plant_part_id, label: { text: "Harvested Plant Part" } do
.row

View File

@@ -26,7 +26,7 @@ describe "Harvesting a crop", :js, :search do
within "form#new_harvest" do
choose plant_part.name
fill_in "When?", with: "2014-06-15"
fill_in "When?", with: Time.new(2014, 06, 15)
fill_in "How many?", with: 42
fill_in "Weighing (in total)", with: 42
fill_in "Notes", with: "It's killer."