title: sorting divs by date
body: <p>This is my html. There are some options. Each of them has elements p: date and name. I need to sort these divs by date via p "date". Ignore the p with names </p>
  
  <pre><code>&lt;div id="divs"&gt;
      &lt;div class="option"&gt;
          &lt;small class="text-muted"&gt;&lt;i class="fa fa-clock-o date"&gt;&lt;/i&gt;12.10.2018 12:05&lt;/small&gt;
          &lt;p class="name"&gt;Jones&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="option"&gt;
          &lt;small class="text-muted"&gt;&lt;i class="fa fa-clock-o date"&gt;&lt;/i&gt;12.11.2015 02:25&lt;/small&gt;
          &lt;p class="name"&gt;Micheal&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="option"&gt;
          &lt;small class="text-muted"&gt;&lt;i class="fa fa-clock-o date"&gt;&lt;/i&gt;02.11.2020 21:50&lt;/small&gt;
          &lt;p class="name"&gt;Micheal&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How to sort divs by date in class "date". I tried this script</p>
  
  <pre><code>var listitems = document.querySelectorAll('#option &gt; date');
  
  listitems.sort(function(a, b) {
     return    $(b).text().toUpperCase().localeCompare($(a).text().toUpperCase());
  });
  
  $.each(listitems, function(index, item) {
     mylist.append(item); 
  });
  </code></pre>