% condition_id = condition.try(:id) || condition[:id] %>
<%# If the condition is not a refinements, it comes from the criterion form object, if it is
a refinement it's still a hash %>
<% if ['st', 'nst'].include? input[:clause] %>
<% elsif ['exct', 'gt', 'lt'].include? input[:clause] %>
<%= t("refine.refine_blueprints.clauses.date_condition.number_of") %>
"
data-input-key="days"
data-action="input->refine--update#value blur->refine--update#refreshFromServer"
data-input-id='<%= input_id if defined? input_id %>'
/>
<%= t("refine.refine_blueprints.clauses.date_condition.days") %>
data-controller="refine--defaults"
data-refine--defaults-input-value="{ "modifier": "ago" }"
data-refine--defaults-criterion-id-value="<%= criterion_id %>"
data-refine--defaults-input-key-value="<%= input_key_value if defined? input_key_value %>"
<% end %>
data-input-id='<%= input_id if defined? input_id %>'
data-input-key="modifier"
data-action="change->refine--update#value"
>
selected<% end %>
value="ago"
>
<%= t("refine.refine_blueprints.clauses.date_condition.ago") %>
selected<% end %>
value="from_now"
>
<%= t("refine.refine_blueprints.clauses.date_condition.from_now") %>
<%= render partial: 'refine/blueprints/criterion_errors', locals: { criterion: criterion } %>
<% else %>
<%= render partial: "refine/blueprints/clauses/date_picker", locals: {
criterion: criterion,
label: t("refine.refine_blueprints.clauses.date_condition.first_date"),
condition_id: condition_id,
date: input[:date1],
input_key: 'date1',
input_id: defined?(input_id) && input_id,
} %>
<%= render partial: 'refine/blueprints/criterion_errors', locals: { criterion: criterion } %>
<% if (input[:clause] == 'btwn' || input[:clause] == 'nbtwn') %>
<%= t("refine.refine_blueprints.clauses.date_condition.and") %>
<%= render partial: "refine/blueprints/clauses/date_picker", locals: {
criterion: criterion,
label: t("refine.refine_blueprints.clauses.date_condition.second_date"),
condition_id: condition_id,
date: input[:date2],
input_key: 'date2',
input_id: defined?(input_id) && input_id,
} %>
<% end %>
<% end %>