Skip to content

Commit

Permalink
Prevents date fields to be submitted manually
Browse files Browse the repository at this point in the history
  • Loading branch information
Kostas Sklias committed Dec 14, 2023
1 parent 79f01b5 commit e760489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/activities/_filters.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<span class="form-label mb-2 d-block">Date range</span>
<div class="d-flex flex-column flex-sm-row gap-3 w-100">
<div class="input-group">
<%= f.date_field :period_start, max: Date.today, placeholder: 'From date', value: params[:period_start], class: 'form-control form-control-sm' %>
<%= f.date_field :period_start, max: Date.today, placeholder: 'From date', value: params[:period_start], class: 'form-control form-control-sm', onkeydown: "return false" %>
<%= f.label :period_start, class: 'visually-hidden' %>
<span class="input-group-text input-group-sm">to</span>
<%= f.label :period_end, class: 'visually-hidden' %>
<%= f.date_field :period_end, max: Date.today, placeholder: 'To date', value: params[:period_end] || Date.today, class: 'form-control form-control-sm' %>
<%= f.date_field :period_end, max: Date.today, placeholder: 'To date', value: params[:period_end] || Date.today, class: 'form-control form-control-sm', onkeydown: "return false" %>
</div>

<%= link_to project_activities_path(current_project.id), class: 'text-error-hover text-nowrap d-flex align-items-center' do %>
Expand Down

0 comments on commit e760489

Please sign in to comment.