KevinVandy / material-react-table

A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript
https://material-react-table.com
MIT License
1.51k stars 436 forks source link

Filtering by data in italian localization #801

Open mauro-rogledi opened 11 months ago

mauro-rogledi commented 11 months ago

material-react-table version

2.0.3

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

Trying to filter by date, with filterFn: "lessThanOrEqualTo", with italian language gives an incorrect result: Enter "16/10/1960" and the table is empty. Enter "17/10/1960" and the table will appear in the row with the date "16/10/1960".

with filterFn: "equals" the table is always empty

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/s/react-table-fkjzdc or with an your example https://codesandbox.io/p/sandbox/bugfilterdata-wl4ym4

Screenshots or Videos (Optional)

No response

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

None

Terms

KevinVandy commented 11 months ago

I don't see this having to do with the locale. But if you use equals for dates, they have to be the exact same dates. You might even want to provide your own custom filterFn for a date equality comparison.

ArminKvasnicka commented 11 months ago

Hi @KevinVandy . It's not caused by the locale but by the user's computer timezone. I am in the timezone +1 hour to UTC (Berlin). When I fill the date March 20, 2014 in the "Start Date" column of your demo at https://www.material-react-table.com/docs/examples/advanced, the table doesn't show anything, even though there is exactly such a record. Don't be misled by displaying 20.3.2014 ... we in Europe have it displayed that way. obrazek

and filtering: obrazek

ArminKvasnicka commented 11 months ago

@KevinVandy Do you plan to fix this issue?

ArminKvasnicka commented 11 months ago

@mauro-rogledi How did you solved this issue? Or are you waiting for fixing this bug?