Skip to content

Commit

Permalink
have defaults on date inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Bartels committed Dec 20, 2023
1 parent d8f3fd3 commit 049287b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/application/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
%i.fa-solid.fa-circle-info
%p Choose a date you would like to reserve a desk on. It will pick a random free desk from your tenant.
= simple_form_for Reservation.new do |f|
= f.input :start_date, as: :datetime, html5: true
= f.input :start_date, as: :datetime, html5: true, input_html: { value: DateTime.now.utc.beginning_of_day + 1.day }
= f.input :user_id, as: :hidden, input_html: { value: @current_user.id }
= f.button :submit, class: 'btn btn-success'

Expand Down
4 changes: 2 additions & 2 deletions app/views/limitations/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.col-md-12

= f.input :name
= f.input :start_date, as: :datetime, html5: true
= f.input :end_date, as: :datetime, html5: true
= f.input :start_date, as: :datetime, html5: true, input_html: { value: DateTime.now.utc.beginning_of_day + 1.day }
= f.input :end_date, as: :datetime, html5: true, input_html: { value: DateTime.now.utc.beginning_of_day + 2.days }

= f.button :submit, class: 'btn btn-success'
2 changes: 1 addition & 1 deletion app/views/reservations/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.row
.col-md-12

= f.input :start_date, as: :datetime, html5: true
= f.input :start_date, as: :datetime, html5: true, input_html: { value: DateTime.now.utc.beginning_of_day + 1.day }
= f.input :desk_id, collection: Desk.all, label_method: :name, value_method: :id
- if @current_role == "admin"
= f.input :user_id, collection: User.all, label_method: :email, value_method: :id
Expand Down

0 comments on commit 049287b

Please sign in to comment.