title: Filter by date range in Datatable problem
body: <p>I'm implementing a date range filter in datatables, when displaying the column date in format YYYY-MM-DD , the filter works perfectly,  but I need to display the column in DD-MM-YYYY format , so i applied moment .</p>
  
  <p>callback function using moment in datatable:</p>
  
  <pre><code>{ targets : [8], 
  
  render : function (data, type, row) {
     return  moment(data).format('DD/MM/YYYY')
  }
  },
  </code></pre>
  
  <p>As a result I see the next day displayed on the columns. image below.
  I would like to filter by date and the columns be ordered in the following format DD/MM/YYYY</p>
  
  <p><a href="https://i.stack.imgur.com/zPCBq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zPCBq.jpg" alt="search datepicker"></a>
  clearly i'm selecting day 10 in datepicker filter and it displays day 11 on the table. </p>
  
  <pre><code>    $(document).ready(function(){
  
      $.fn.dataTable.ext.search.push(
          function (settings, data, dataIndex) {
              var fecha_inicio = $('#fecha_inicio').datepicker("getDate");
              // alert(fecha_inicio);
              var fecha_fin = $('#fecha_fin').datepicker("getDate");
               var arr =  data[8].split('/').reverse().join('-');
               // alert(arr);
               // var temp = arr[0] +'-'+ arr[1] +'-'+arr[2]; 
  
               var startDate = new Date(arr);
               startDate.setHours(0,0,0,0);
                // alert(startDate);
  
  
              if (fecha_inicio == null &amp;&amp; fecha_fin == null)      { return true;}
              if (fecha_inicio == null &amp;&amp; startDate &lt;= fecha_fin) { return true;}
              if(fecha_fin == null &amp;&amp; startDate &gt;= fecha_inicio)  { return true;}
              if (startDate &lt;= fecha_fin &amp;&amp; startDate &gt;= fecha_inicio) { return true;}
              return false;
          }
      );
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6Z52A.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Z52A.jpg" alt="correct filter by date range"></a></p>
  
  <p>If i take out the callback code the column display correctly, except the date format.</p>
  
  <p>Thanks in advance.</p>