-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Support Date
objects in filter model
#7069
Conversation
Deploy preview: https://deploy-preview-7069--material-ui-x.netlify.app/ Updated pages: |
ecb3323
to
836f45e
Compare
It looks like there are no breaking changes here, since both Date and string values are accepted. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
f66b869
to
82bc5e3
Compare
To handle use cases where filter model was serialized and persisted in local storage for later use
Both date and string values are supported, but there's no reason to change the default.
82bc5e3
to
2701aeb
Compare
@@ -18,131 +19,6 @@ import InputBase from '@mui/material/InputBase'; | |||
import locale from 'date-fns/locale/en-US'; | |||
import { styled } from '@mui/material/styles'; | |||
|
|||
function buildApplyDateFilterFn(filterItem, compareFn, showTime = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a positive side-effect of this PR - we can now reuse the getGridDateOperators
for pickers integration instead of rewriting all filter operators 🙂
This reverts commit 2701aeb.
There was a breaking change in the |
Closes #6564
TODO:
Changelog
Breaking changes
filterModel
now supportsDate
objects as values fordate
anddateTime
column types.The
filterModel
still accepts strings as values fordate
anddateTime
column types,but all updates to the
filterModel
coming from the UI (e.g. filter panel) will set the value as aDate
object.