Reactjs 如何正确使用MUI日期范围选择器实现react表过滤

Reactjs 如何正确使用MUI日期范围选择器实现react表过滤,reactjs,material-ui,react-table,daterangepicker,Reactjs,Material Ui,React Table,Daterangepicker,我真的很难使用和从MUI选择器实现日期范围过滤。说实话,我不知道如何实现这一点。下面是我想做的。请帮忙 这是我的自定义日期范围筛选器: export const SelectDateRangeFilter = ({ column: { filterValue = [null, null], preFilteredRows, setFilter, id }, }) => { const [selectedDate, setSelectedDate] = useState([null,

我真的很难使用和从MUI选择器实现日期范围过滤。说实话,我不知道如何实现这一点。下面是我想做的。请帮忙

这是我的自定义日期范围筛选器:

export const SelectDateRangeFilter = ({
  column: { filterValue = [null, null], preFilteredRows, setFilter, id },
}) => {
  const [selectedDate, setSelectedDate] = useState([null, null])

  return (
    <LocalizationProvider dateAdapter={DateFnsUtils} locale={localeMap.pl}>
      <DateRangePicker
        startText="From"
        endText="To"
        value={selectedDate}
        mask={maskMap.en}
        onChange={(date) => {
          setSelectedDate(date)

          setFilter((old) => {
            return [Date.parse(date[0]) / 1000, Date.parse(date[1]) / 1000]
          })
        }}
        disableFuture
        name="calendar"
        renderInput={(startProps, endProps) => (
          <>
            <CustomMuiTextField size="small" {...startProps} />
            <CustomMuiTextField size="small" {...endProps} />
          </>
        )}
      />
    </LocalizationProvider>
  )
}
{
    Header: 'Date',
    accessor: 'createTimestamp.seconds',
    Filter: SelectDateRangeFilter,
    filter: 'between',
    Cell: (props) => {
      const date = format(
        fromUnixTime(props.row.original.createTimestamp.seconds),
        'dd-MM-yyyy',
      )

      return date
    },
  },