在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ ant design Table組件排序sorter

ant design Table組件排序sorter

{
    title: '報(bào)警時(shí)間',
    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>;
       }
  },
  

圖片描述

對(duì)查詢結(jié)果進(jìn)行升序排列后,出現(xiàn)排序錯(cuò)誤。報(bào)警時(shí)間后面的兩個(gè)時(shí)間排序按鈕功能不統(tǒng)一,向上的按鈕只能進(jìn)行降序排列,向下的按鈕都可以.我的sorter的排序有什么問題啊?急求!謝謝!

回答
編輯回答
遲月

時(shí)間盡量使用時(shí)間戳。
比較可以直接使用時(shí)間戳相減了。也可以使用momentjs的一些方法,比如:isAfter isBefore等。

2017年10月29日 12:44