title: Convert RFC 3339 date to dd-M-yyyy in javascript or jQuery?
body: <p>I have a large table returning data from solr, I can't do anything server side so I need to use client side javascript and the date format emitted is: </p>
  
  <pre><code>yyyy-mm-ddThh:mm:ssZ
  </code></pre>
  
  <p>Lovely. I want it to display as:</p>
  
  <pre><code>dd-M-yyyy (or 21-Jan-2011, for example)
  </code></pre>
  
  <p>Each date is in a td with a class of "formatdate". I thought something like this (below) would work, sitting inside a </p>
  
  <pre><code>$(document).ready(function()
  </code></pre>
  
  <p>and format everything "automagically", but no such luck; </p>
  
  <pre><code>$('.formatdate').each(function() {
  var date = document.getElementByClassName('formatdate');
  $(".formatdate").innerHTML = new Date(date);
  });
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>EDIT: The other side of this is, inserting this</p>
  
  <pre><code>"mRender": function(date, type, full) { return new Date(date).toDateString(); }
  </code></pre>
  
  <p>into datatables returns "Fri Nov 2 2012", but then I have zero formatting options - it really has to be "02-Nov-2012"... Thanks again!</p>