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

[DataGrid] Date operators not working with date-time values #1710

Closed
2 tasks done
m4theushw opened this issue May 19, 2021 · 2 comments · Fixed by #1722
Closed
2 tasks done

[DataGrid] Date operators not working with date-time values #1710

m4theushw opened this issue May 19, 2021 · 2 comments · Fixed by #1722
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!

Comments

@m4theushw
Copy link
Member

m4theushw commented May 19, 2021

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

If the value of a date or dateTime column has the hour and minutes set, most of the filter operators don't work. The only operators that return results are "is on or after/before", but they don't match with values that have the exact date ("is" part).

Expected Behavior 🤔

Filter operators in date columns should consider only the date components (day, month and year). In dateTime columns, the operator should compare the date components and also the hour and minutes components, ignoring the seconds.

Steps to Reproduce 🕹

Steps:

  1. Open https://material-ui.com/components/data-grid/demo/#data-grid-demo
  2. Apply a "is" filter on "Maturity Date" or "Trader Date"
  3. Nothing is returned

6a8UUlrqae

Context 🔦

Noticed it while working in #1708.

@m4theushw m4theushw added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 19, 2021
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 20, 2021
@dtassone
Copy link
Member

you need to include the time to be completely equal

@oliviertassinari
Copy link
Member

oliviertassinari commented May 20, 2021

@dtassone So we should strip the time when the column type is 'date' (not 'dateTime') and we do the sorting & filtering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants