title: Invalid Date when trying to sort by date on datatable
body: <p>Hello everyone im trying to sort a data-table by dates i've tried to use moment js however doesn't seem to work at all.</p>
  <p><a href="https://i.stack.imgur.com/z5601.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z5601.png" alt="enter image description here" /></a></p>
  <p>I keep getting the &quot;invalid date&quot; message on the date row.</p>
  <p>The information for the data-table comes from the server, and i receive it like this:</p>
  <pre><code>returnedData[&quot;ingresos&quot;].forEach(function(ingreso){
                      $(&quot;#Parte-data&quot;).append(&quot;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&quot; + ingreso[&quot;fecha_ingreso&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + ingreso[&quot;codigo&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt; -- &lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + ingreso[&quot;orden_ingreso&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt; -- &lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + ingreso[&quot;balance&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + ingreso[&quot;cantidad_ingresada&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt; -- &lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + ingreso[&quot;usuario&quot;][&quot;nombre&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&quot;);
                  });
                  
                  returnedData[&quot;salidas&quot;].forEach(function(salida){
                      
                      $(&quot;#Parte-data&quot;).append(&quot;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;fecha_salida&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;codigo&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;contrato&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + tg + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;cantidad_salida&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;balance&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt; -- &lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;tecnico&quot;][&quot;nombre&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;&quot; + salida[&quot;usuario&quot;][&quot;nombre&quot;] + &quot;&lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;&quot;);
                  });
  </code></pre>
  <p>The information comes from &quot;ingresos&quot; and from &quot;salidas&quot;, and in the data-table i tried this:</p>
  <pre><code>table = $('#Data-parte').DataTable({
                  ordering: false,
                  pageLength: 25,
                  responsive: true,
                  dom: '&lt;&quot;html5buttons&quot;B&gt;lTfgitp',
                  
                  columnDefs:[{
                      targets: 0,
                      render: $.fn.dataTable.render.moment('DD-MM-YYYY', 'DD-MM-YYYY'),
                  }],
              });
  </code></pre>
  <p>The format of the dates i get from the server is dd-mm-yyyy.</p>
  <p>Here is the data I get from the server:</p>
  <p><a href="https://i.stack.imgur.com/32ss4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/32ss4.png" alt="enter image description here" /></a></p>
  <p>Fields used in the dataTable are &quot;fecha_ingreso&quot; from &quot;ingresos&quot; and &quot;fecha_salida&quot; from &quot;salidas&quot;.</p>
  <p>I don't understand what is missing, hope somebody can help me with this please :(</p>