<% value_format = '' if ['>t-', 't+', 't+'].include? selected_operator value_format = 'days' elsif selected_operator == '=d' value_format = 'on-date' elsif selected_operator == '<>d' value_format = 'between-dates' end %>
<%= render partial: 'filters/date/days', locals: { filter: filter, value: value_format == 'days' ? filter.values.first : '' } %> <%= render partial: 'filters/date/on_date', locals: { filter: filter, value: value_format == 'on-date' ? filter.values.first : '' } %> <%= render partial: 'filters/date/between_dates', locals: { filter: filter, from_value: value_format == 'between-dates' ? filter.values.first : '', to_value: value_format == 'between-dates' ? filter.values.second : ''} %>