Ant design Table components sort sorter

{
    title: "",
    className: "listTable listTime",
    dataIndex: "eventtime",
    key: "eventtime",
    width: "12%",
    **sorter: (a, b) => Date.parse(a.eventtime.replace("-","/").replace("-","/")) - Date.parse(b.eventtime.replace("-","/").replace("-","/")),**
    render: (text, record, index) => {
         return <label>{text}</label>;
       }
  },
  

A sorting error occurred after sorting the query results in ascending order. The functions of the two time sorting buttons behind the alarm time are not unified, the upward buttons can only be arranged in descending order, and the downward buttons can. What"s wrong with the ordering of my sorter ? Beg urgently! Thank you!

Mar.10,2021

use timestamps as much as possible. The
comparison can be subtracted directly using a timestamp. You can also use some methods of momentjs , such as isAfter isBefore , and so on.


Thank you, boss, the problem has been solved image.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b38c-2ba93.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b38c-2ba93.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?