title: Sort JSON array by date key
body: <p>I have a json array and I am trying to <strong>sort it by date</strong> before I append it.</p>
  
  <p>The array looks as such:</p>
  
  <pre><code>result = [];
  result.push(
    {id: 'ID', result: {url: 'test', date: '15 May 2013, 6:40 pm'}},
    {id: 'ID', result: {url: 'test', date: '20 Dec 2012, 8:00 am'}},
    {id: 'ID', result: {url: 'test', date: '29 Jun 2012, 5:47 pm'}}
  );
  </code></pre>
  
  <p>Currently, <strong>I have managed to sort an array</strong> of dates as such:</p>
  
  <pre><code>var datearray = [
      '2011-05-26 12:00:00',
      '2016-01-26 12:00:00',
      '2011-01-26 12:00:00',
      '2012-12-08 07:00:00',
      '2011-01-26 12:00:00',
      '1995-01-05 06:00:00'
  ];
  
  datearray.sort();
  </code></pre>
  
  <p>which gives me:</p>
  
  <pre><code>1995-01-05 06:00:00
  2011-01-26 12:00:00
  2011-01-26 12:00:00
  2011-05-26 12:00:00
  2012-12-08 07:00:00
  2016-01-26 12:00:00
  </code></pre>
  
  <p>but <strong>Im not sure how to do the same for a complex array</strong> which contains more keys than one. I know that <em>I should firstly format the date to YYYY-MM-DD</em> but after im kinda messed up.</p>
  
  <p>A good start would be from what I currently came up with found on jsbin: <a href="http://jsbin.com/ipatok/8/edit" rel="nofollow">http://jsbin.com/ipatok/8/edit</a></p>