title: AgGrid JSON date column, sorting filtering is slow for huge data
body: <p>I have a JSON date column in AgGrid with 20K + records. I am using a date comparator to sort dates. Is there a better way then below to sort such date type as i am experiencing slowness in my application while sorting and filtering for huge data set.</p>
  
  <p><strong>For Sorting</strong></p>
  
  <pre><code> comparator: function (date1, date2) {
                  var date1Number = fnDateToComparableNumber(moment(date1).toDate());
                  var date2Number = fnDateToComparableNumber(moment(date2).toDate());
  
                  if ((date1Number === null || isNaN(date1Number)) &amp;&amp; (date2Number === null || isNaN(date2Number))) {
                      return 0;
                  }
                  if (date1Number === null || isNaN(date1Number)) {
                      return -1;
                  }
                  if (date2Number === null || isNaN(date2Number)) {
                      return 1;
                  }
  
                  return date1Number - date2Number;
              }
  </code></pre>
  
  <p><strong>For Filtering</strong></p>
  
  <pre><code>filterParams: {
                  //applyButton: true,
                  clearButton: true,
                  // provide comparator function
                  comparator: function (filterLocalDateAtMidnight, cellValue) {
                      // We create a Date object for comparison against the filter date
                      if (cellValue == '') {
                          return 1;
                      }
  
                      var cellDate = moment(cellValue).toDate();
  
                      // Now that both parameters are Date objects, we can compare
                      if (cellDate &lt; filterLocalDateAtMidnight) {
                          return -1;
                      } else if (cellDate &gt; filterLocalDateAtMidnight) {
                          return 1;
                      } else {
                          return 0;
                      }
                  }
              },
  </code></pre>
  
  <p>Note: </p>
  
  <ol>
  <li>I am using moment for date manipulations</li>
  <li>JSON date is required for excel export. Else processCellCallback is expensive in case of big data. 
  I have done some hack for excel format else excel will display date as number.</li>
  <li>We have enterprise license for Ag-Grid </li>
  </ol>