material-react-table icon indicating copy to clipboard operation
material-react-table copied to clipboard

Filtering by data in italian localization

Open mauro-rogledi opened this issue 2 years ago • 4 comments

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

  • [X] 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.

mauro-rogledi avatar Nov 07 '23 11:11 mauro-rogledi

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.

KevinVandy avatar Nov 09 '23 15:11 KevinVandy

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 avatar Nov 10 '23 20:11 ArminKvasnicka

@KevinVandy Do you plan to fix this issue?

ArminKvasnicka avatar Nov 21 '23 09:11 ArminKvasnicka

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

ArminKvasnicka avatar Nov 28 '23 11:11 ArminKvasnicka