title: How to Sort <li> by Month Date & Year
body: <p>I need some help sorting the following list, I have done some research tried the following using JavaScript, but its not working as my date format  <strong>January 20 2020</strong> </p>
  
  <p>Code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(function($) {
    var container = $(".sort-list");
    var items = $(".sort-item");
  
    items.each(function() {
      // Convert the string in 'data-event-date' attribute to a more
      // standardized date format
      var BCDate = $(this).attr("data-event-date").split("-");
      var standardDate = BCDate[1] + " " + BCDate[0] + " " + BCDate[2];
      standardDate = new Date(standardDate).getTime();
      $(this).attr("data-event-date", standardDate);
  
    });
  
    items.sort(function(a, b) {
      a = parseFloat($(a).attr("data-event-date"));
      b = parseFloat($(b).attr("data-event-date"));
      return a &gt; b ? -1 : a &lt; b ? 1 : 0;
    }).each(function() {
      container.prepend(this);
    });
  
  })(jQuery);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;ul class="sort-list"&gt;
    &lt;li class="sort-item" data-event-date="August 21 2020"&gt;August 21 2020&lt;/li&gt;
    &lt;li class="sort-item" data-event-date="April 25 2020"&gt;April 25 2020&lt;/li&gt;
    &lt;li class="sort-item" data-event-date="May 25 2020"&gt;May 25 2020&lt;/li&gt;
    &lt;li class="sort-item" data-event-date="September 25 2020"&gt;September 25 2020&lt;/li&gt;
    &lt;li class="sort-item" data-event-date="May 13 2020"&gt;May 13 2020&lt;/li&gt;
    &lt;li class="sort-item" data-event-date="June 1 2020"&gt;June 1 2020&lt;/li&gt;
    &lt;li class="sort-item" data-event-date="December 4 2020"&gt;December 4 2020&lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>