title: How to use bootstrap datetimepicker to filter dates in bootstrap table?
body: <p>I'm using WebAPI(JSON) in my tables and I need to filter the "dates" using datetimepicker in bootstrap-table. Pls. someone help me.</p>
  
  <p>Note: Timestamp is the date need to filter</p>
  
  <p>Table - this is to call WebApi in my tables</p>
  
  <pre><code>var WebApi = "http://track.asiacom.co.th/fmswebapi/api/posinfo";
  $(document).ready(function () {
      $('#report').bootstrapTable({
          idField: 'PosID',
          url: WebApi,
          columns: [{
              field: 'PosID',
              title: 'id',
              class: 'hidden-xs hidden-sm hidden-md hidden-lg hidden-desktop'
          }, {
              field: 'Asset',
              title: 'Vehicle'
          }, {
              field: 'Tag',
              title: 'Device'
          }, {
              field: 'Location',
              title: 'Location'
          }, {
              field: 'Timestamp',
              title: 'Timestamp',
              formatter: timestampFormatter
          }, {
              field: 'Battery',
              title: 'Battery'
          }, {
              field: 'Engine',
              title: 'Engine',
              formatter: engineFormatter
          }, {
              field: 'Ignition',
              title: 'Ignition',
              formatter: ignitionFormatter
          }]
      });
  });
  </code></pre>
  
  <p>HTML - this is the datetimepicker form</p>
  
  <pre><code>&lt;input id="dateFrom" type="text" class="form-control" placeholder="DD-MMM-YYYY HH:MM"&gt;
  &lt;input id="dateFrom" type="text" class="form-control" placeholder="DD-MMM-YYYY HH:MM"&gt;&lt;br/&gt;
  &lt;input id="dateTo" type="text" class="form-control" placeholder="DD-MMM-YYYY HH:MM"&gt;
  &lt;small class="text-muted pull-left"&gt;To&lt;/small&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>$('#dateFrom').datetimepicker({
      format: 'dd-M-yyyy hh:ii:ss P',
      autoclose: 'true',
      todayBtn: 'true',
      todayHighlight: 'true',
      keyboardNavigation: 'true'
  });
  
  $('#dateTo').datetimepicker({
      format: 'dd-M-yyyy hh:ii:ss P',
      autoclose: 'true',
      todayBtn: 'true',
      todayHighlight: 'true',
      keyboardNavigation: 'true'
  });
  </code></pre>
  
  <p>To Convert the date</p>
  
  <pre><code>function timestampFormatter(value, row) {
      var t = value;
  
      function convertUTCDateToLocalDate(date) {
          var newDate = new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);
          var offset = date.getTimezoneOffset() / 60;
          var hours = date.getHours();
          newDate.setHours(hours - offset);
          return newDate;
      }
  
      var date = convertUTCDateToLocalDate(new Date(t));
      var timestamp = moment(date.toLocaleString()).format("D-MMM-YYYY, hh:mm:ss A");
      return '&lt;div&gt;' + '&lt;span&gt;&lt;i class="fa fa-clock-o hidden-xs hidden-md"&gt;&lt;/i&gt;&amp;nbsp;' + timestamp + '&lt;/span&gt;' + '&lt;/div&gt;';
  }
  </code></pre>