-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[docs] Using data grid with date pickers #5053
[docs] Using data grid with date pickers #5053
Conversation
These are the results for the performance tests:
|
f29fef5
to
0deb720
Compare
export default function EditingWithDatePickers() { | ||
return ( | ||
<div style={{ height: 300, width: '100%' }}> | ||
<LocalizationProvider dateAdapter={AdapterDateFns}> |
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.
The date formats between view mode and edit are different. In view mode I see the dates as dd/mm/YYYY
(same as new Date().toLocaleDateString()
), but on edit mode it's mm/dd/YYYY
). I think we should provide some instructions explaining that the date format must be changed according to the locale, or find a way to make it work automatically. Related to https://mui.com/x/react-date-pickers/localization/#date-engine-locale
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.
Nice catch! I've used dateAdapter
in valueFormatter
to make sure data formats are the same in view and edit mode, even when locale is changed
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.
Great, could you add a warning saying that the import must be changed to change the date format?
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.
Done
0deb720
to
8f97d4a
Compare
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.
f34c038
to
cc8e020
Compare
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 looking great! 👌
As a side note, the font size in the textbox looks off the expected design values from the theme for native and non native date pickers: |
@oliviertassinari Nice catch! |
@cherniavskii @cherniavskii Was it released? I am using v6 version of MUI but still, the date filter uses a native date picker from the browser. |
Closes #4909 until we provide out of the box support for pickers in data grid
Preview: https://deploy-preview-5053--material-ui-x.netlify.app/x/react-data-grid/editing/#usage-with-mui-x-date-pickers
DatePicker
fordate
column typeDatePicker
fordate
column filter inputDateTimePicker
fordateTime
column typeDateTimePicker
fordateTime
column filter input