title: Date time sorting in react table on particular column (column name transaction date)
body: <p>I am using react table and wanted to sort date time but its not sorting properly either ascending order or descending order.</p>
  
  <p>column defined code: Using below code to sort the date time.</p>
  
  <pre><code>{Header: 'Transaction Date',accessor: 'transationDate', style: {textAlign: "center"},
                            sortMethod: (a, b) =&gt; {
                              var a1 = new Date(a).getTime();
                              var b1 = new Date(b).getTime();
                            if(a1&lt;b1)
                            return 1;
                            else if(a1&lt;b1)
                            return -1;
                            else
                            return 0;
                            }
                          },
  </code></pre>
  
  <p>descending order Sorted Result: </p>
  
  <p><a href="https://i.stack.imgur.com/VHq4T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VHq4T.png" alt="enter image description here"></a></p>