0

Hi I'm trying to filter some data in react admin using the date input filter that is set to MM/DD/YYYY however the server that I am fetching from has the date listed as "date": "2021-11-27T00:00:00Z". I was wondering if there is a way to filter by date either by parsing the date above or using another way.

Here is my code:

const DateFilter = (props: any) => (<Filter {...props}>
    <DateInput placeholder='Date' source='date' />
</Filter>);
niconi
  • 41
  • 1
  • 8

1 Answers1

1

Input elements have properties: format / parse with which you can convert the value to the desired form: https://marmelab.com/react-admin/Inputs.html#transforming-input-value-tofrom-record

MaxAlex
  • 2,919
  • 1
  • 14
  • 14