title: how to do Enum.sort_by & search with created_at date Elixir
body: <p>I have this data, </p>
  
  <pre><code>[       
    %{
      company_id: "ocsc.ie",
      created_at: "Wednesday, 08 Mar 2017  6:14 AM",
      name: "O&amp;#39;Connor Sutton Cronin",
      session_count: 2,
      user_count: 8
    },
    %{
      company_id: "virtuspm.ie",
      created_at: "Tuesday, 10 Jul 2018  8:48 AM",
      name: "VIRTUS",
      session_count: 1,
      user_count: 7
    },
    %{
      company_id: "garlandconsultancy.com",
      created_at: "Wednesday, 20 Jun 2018  3:32 PM",
      name: "Garland",
      session_count: 1,
      user_count: 3
    },
    %{
      company_id: "protectorsecurity.co.uk",
      created_at: "Friday, 31 Aug 2018 11:03 AM",
      name: "Protector Security Group",
      session_count: 4,
      user_count: 9
    },
    %{
      company_id: "tcd.ie",
      created_at: "Wednesday, 01 Mar 2017  7:39 AM",
      name: "TCD",
      session_count: 4,
      user_count: 18
    }
  ]
  </code></pre>
  
  <p>I am trying to sort this according to different values.</p>
  
  <pre><code> Enum.sort_by(data, &amp;(&amp;1.user_count), &amp;Kernel.&gt;=/2)
  </code></pre>
  
  <p>Integer and string both, the above expression is working.</p>
  
  <p>I have tried for integer values, my concern is how we can sort by date?
  Also, can we search through values? with <code>like</code> expression? just for <code>name</code> and <code>company_id</code>, where you pass the search query as <code>gar</code>.</p>
  
  <pre><code>  [%{
      company_id: "garlandconsultancy.com",
      created_at: "Wednesday, 20 Jun 2018  3:32 PM",
      name: "Garland",
      session_count: 1,
      user_count: 3
    }]
  </code></pre>
  
  <p>.
  So all those maps which are similar to search query filtered.</p>
  
  <p>I have tried this </p>
  
  <pre><code>Enum.filter(data, fn(x) -&gt; String.match?(String.downcase(x.name), ~r/String.downcase("VIR")/) end)
  </code></pre>
  
  <p>It's not working either.Any help would be so thankful.</p>