Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter variant of date-range doesn't work with a display mode of custom #1286

Open
1 task done
kelarcrisp opened this issue Oct 30, 2024 · 0 comments
Open
1 task done

Comments

@kelarcrisp
Copy link

kelarcrisp commented Oct 30, 2024

material-react-table version

2.13

react & react-dom versions

18.3

Describe the bug and the steps to reproduce it

in the custom filter ui example (seen here) if you add a column that uses a date-range filterVariant, you'll see the following error

Error: MUI X: Can not find the date and time pickers localization context.
It looks like you forgot to wrap your component in LocalizationProvider.
This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package

here's the column using the date-range filter

   {
        accessorFn: originalRow => new Date(originalRow.gender), // convert to date for sorting and filtering
        id: 'gender',
        header: 'Gender',
        filterVariant: 'date-range',
        Cell: ({ cell }) => cell.getValue().toLocaleDateString(), // convert back to string for display
      },

Minimal, Reproducible Example - (Optional, but Recommended)

original sandbox https://www.material-react-table.com/docs/examples/custom-filter-ui#custom-filter-ui-example
I do have the component wrapped in a localization provider and I'm using date-fns v3 as the adapter

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant