<commit_before><%
  if params[filter.to_s].is_a?(Hash)
    date_from = params[filter.to_s]["from"]
    date_to = params[filter.to_s]["to"]
  else
    date_from = ""
    date_to = ""
  end

  date_format = Date::DATE_FORMATS[@resource[:class].typus_date_format(filter)]
%>

<h2><%= @resource[:class].human_attribute_name(filter) %></h2>
<ul>
<% form_tag url_for(:controller => params[:controller]), :method => :get do %>
  <li>
    <%= text_field_tag "#{filter}[from]", date_from, :size => 10, :class => :date_input, :date_format => date_format %>
    -
    <%= text_field_tag "#{filter}[to]", date_to, :size => 10, :class => :date_input, :date_format => date_format %>
  </li>
  <li>
    <%= hidden_params.sort.join("\n").html_safe! %>
    <%= submit_tag _("Filter") %>
  </li>
<% end %>
</ul><commit_msg>Fixed the form used to filter items by data range.<commit_after><%
  if params[filter.to_s].is_a?(Hash)
    date_from = params[filter.to_s]["from"]
    date_to = params[filter.to_s]["to"]
  else
    date_from = ""
    date_to = ""
  end

  date_format = Date::DATE_FORMATS[@resource[:class].typus_date_format(filter)]
%>

<h2><%= @resource[:class].human_attribute_name(filter) %></h2>
<ul>
<% form_tag url_for(:controller => params[:controller], :action => params[:action]), :method => :get do %>
  <li>
    <%= text_field_tag "#{filter}[from]", date_from, :size => 10, :class => :date_input, :date_format => date_format %>
    -
    <%= text_field_tag "#{filter}[to]", date_to, :size => 10, :class => :date_input, :date_format => date_format %>
  </li>
  <li>
    <%= hidden_params.sort.join("\n").html_safe! %>
    <%= submit_tag _("Filter") %>
  </li>
<% end %>
</ul>
{'fraction_non_alphanumeric': 0.21611940298507462, 'fraction_numerical': 0.007164179104477612, 'mean_word_length': 4.441558441558442, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4996376', 'n_tokens_mistral': 660, 'n_tokens_neox': 625, 'n_words': 110}