title: How to sort by date correctly with jQuery Plugin Data Tables
body: <p>I'd like to know how I can sort my tables by a date correctly.
  I'm using jquery with the plugin Data Tables (http://datatables.net/).</p>
  
  <p>I also found a useful plugin on this site for my problem, which I integrated into my code.
  My JS-Code looks like this:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
  
  jQuery.fn.dataTableExt.oSort['uk_date-asc']  = function(a,b) {
      var ukDatea = a.split('/');
      var ukDateb = b.split('/');
  
      var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
      var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
  
      return ((x &lt; y) ? -1 : ((x &gt; y) ?  1 : 0));
  };
  
  jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a,b) {
      var ukDatea = a.split('/');
      var ukDateb = b.split('/');
  
      var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
      var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
  
      return ((x &lt; y) ? 1 : ((x &gt; y) ?  -1 : 0));
  };
  
     var oTable = $('#example').dataTable( {
          "bJQueryUI": true,
          "sPaginationType": "full_numbers",
          "aoColumns": [
              null,
              { "sType": "uk_date" },
              null,
              null,
              null,
              null,
              null
          ]
      } );
  
  
  $(".search_init").click(function(){
      var input_value = $(this).val();
      $(this).val("");
  });     
  
  $("tfoot input").keyup( function () {
      oTable.fnFilter( this.value, $("tfoot input").index(this) );
  } );
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>My table looks like this:</p>
  
  <pre><code>&lt;table id="example"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Some Text&lt;/th&gt;
          &lt;th&gt;Date&lt;/th&gt;
          &lt;th&gt;Some Text&lt;/th&gt;
          &lt;th&gt;Some Text&lt;/th&gt;
          &lt;th&gt;Some Text&lt;/th&gt;
          &lt;th&gt;Some Text&lt;/th&gt;
          &lt;th&gt;Some Text&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Some text&lt;/td&gt;
          &lt;td&gt;22/07/2011&lt;/td&gt;
          &lt;td&gt;Some text&lt;/td&gt;
          &lt;td&gt;Some text&lt;/td&gt;
          &lt;td&gt;Some text&lt;/td&gt;
          &lt;td&gt;Some text&lt;/td&gt;
          &lt;td&gt;Some text&lt;/td&gt;
      &lt;/tr&gt;
      ...
  &lt;/tbody&gt;
  &lt;tfoot&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="search_init" value="Text" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tfoot&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Could someone explain me why this isn't working?
  I'm able to sort each column except the one with the dates in it.</p>
  
  <p>I include following libraries:</p>
  
  <pre><code>&lt;script src="[PATH]/js/jquery-1.6.2.min.js" language="JavaScript" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="[PATH]/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="[PATH]/js/jquery.dataTables.min.js" language="JavaScript" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="[PATH]/js/ZeroClipboard.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  &lt;script src="[PATH]/js/TableTools.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  </code></pre>